 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Invalid User
Joined: 14 Feb 2005 Posts: 442 Location: Texas, Usa
|
Posted: Wed Mar 09, 2005 7:16 pm Post subject: Audio |
|
|
I am having trouble with a previously working script, The sound doesn not play, The vol is not the issue, and other media players still play, any suggestions?
| Code: | Play:
GuiControlGet, SongName,, %ListBoxName%
SoundPlay, %SongName%, 1
Return |
_________________ my lame sig  |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5390 Location: /b/
|
Posted: Wed Mar 09, 2005 7:21 pm Post subject: |
|
|
Have you tried to substitute %SongName% for the actual path or tried something like *-1 instead; this is a general guidline to check different thigs eleminating problems. _________________
 |
|
| Back to top |
|
 |
IU Guest
|
Posted: Wed Mar 09, 2005 7:31 pm Post subject: |
|
|
| Well I have done testing with msg box, and it gives me the correct song out of the correct listbox, so do you think a full path should work, cus this thing worked last week... |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5390 Location: /b/
|
Posted: Wed Mar 09, 2005 7:35 pm Post subject: Re: Audio |
|
|
| Invalid User wrote: | | other media players still play | Testing myself I've found no problems. Was any other sound player on at the same time? The documentation doesn't say that the FileName param shouldn't be variables so I assume it should be ok. _________________
 |
|
| Back to top |
|
 |
Invalid User
Joined: 14 Feb 2005 Posts: 442 Location: Texas, Usa
|
Posted: Wed Mar 09, 2005 7:38 pm Post subject: |
|
|
I mean this is retarded!, I hope its a typo somewhere, but if the song name is correct then it should be working, Would a reformatting job be a key issue in this, becuase thats when this stoped working? _________________ my lame sig  |
|
| Back to top |
|
 |
Invalid User
Joined: 14 Feb 2005 Posts: 442 Location: Texas, Usa
|
Posted: Wed Mar 09, 2005 7:43 pm Post subject: |
|
|
| Code: | LoopState = ON
NoSoundFile = ThisIsANonExistingSoundFile.wav
EStat = 0
Request = No
Gui, Color, Black
Menu, FileMenu, Add, Add Song File, AddFile
Menu, FileMenu, Add, Remove Song File, RemoveSongFile
Menu, FileMenu, Add, Open Play List, OpenPlayList
Menu, FileMenu, Add, Save Play List, SavePlayList
Menu, FileMenu, Add, Exit, Exit
Menu, FunctionsMenu, Add, Play, Play
Menu, FunctionsMenu, Add, Pause, Pause
Menu, FunctionsMenu, Add, Stop, Stop
Menu, FunctionsMenu, Add, Skip Forward, Forward
Menu, FunctionsMenu, Add, Skip Back, Back
Menu, FunctionsMenu, Add, Loop ON/Off Toggle, LoopToggle
Menu, FunctionsMenu, Add, Eject CD, Eject
Menu, AutomationMenu, Add, Start Automation, StartAutoPlay
Menu, AutomationMenu, Add, Stop Automation, StopAutoPlay
Menu, AutomationMenu, Add, Insert Request, InsertRequest
Menu, MyMenuBar, Add, File, :FileMenu ; Attach the three sub-menus that were created above.
Menu, MyMenuBar, Add, Functions, :FunctionsMenu
Menu, MyMenuBar, Add, Automation, :AutomationMenu
Menu, MyMenuBar, Add, Options, OptionsMenu ;Add Options to menu
Gui, Menu, MyMenuBar
Gui, Add, Picture, gBack x6 y10 w40 h40, %A_ScriptDir%\Back.bmp
Gui, Add, Picture, gForward x56 y10 w40 h40, %A_ScriptDir%\Forward.bmp
Gui, Add, Picture, gPause x106 y10 w40 h40, %A_ScriptDir%\Pause.bmp
Gui, Add, Picture, gStop x156 y10 w40 h40, %A_ScriptDir%\Stop.bmp
Gui, Add, Picture, gPlay x206 y10 w40 h40, %A_ScriptDir%\Play.bmp
Gui, Add, Picture, gLoopToggle vLoopStat x306 y10 w80 h40, %A_ScriptDir%\LoopOn.bmp
Gui, Add, Picture, gEject x256 y10 w40 h40, %A_ScriptDir%\Eject.bmp
Gui, Add, Picture, vWarningState x316 y460 w10 h10, %A_ScriptDir%\OffLight.bmp
Gui, Add, Picture, vAutoCueState x6 y270 w10 h10, %A_ScriptDir%\GreenLight.bmp
Gui, Add, Picture, vRequestState x6 y90 w10 h10, %A_ScriptDir%\YellowLight.bmp
Gui, Add, ListBox, gUCLR vRequestList x36 y110 w430 h160, RequestList ;UCLA -update current list A:auto R:request
Gui, Add, ListBox, gUCLA vAutoCueList x36 y290 w430 h160, Auto List
Gui, Add, Text, cWhite x16 y90 w110 h20, Live Cue/Request List
Gui, Add, Text, cWhite x16 y270 w100 h20, Auto Cue List
Gui, Add, Text, cWhite x6 y460 w80 h20, Time Remaining:
Gui, Add, Text, cWhite x96 y460 w40 h20, Time
Gui, Add, Text, cWhite x336 y460 w130 h20, Time Remaining Warning
Gui, Add, Button, gAddSongFile x6 y60 w50 h30, Add Song
Gui, Add, Button, gRemoveSongFile x56 y60 w50 h30, Remove Song
Gui, Add, Button, gStartAutoPlay x116 y270 w100 h20, Start Automation
Gui, Add, Button, gStopAutoPlay x216 y270 w100 h20, Stop Automation
Gui, Add, Button, gInsertRequest x316 y270 w100 h20, Insert Request
Gui, Add, Button, gSavePlayList x116 y60 w50 h30, Save Play List
Gui, Add, Button, gOpenPlayList x166 y60 w50 h30, Open Play List
Gui, Show, x132 y80 h483 w477, Auto DJ v2.0
Return
;-----------------------------------------------------------------------------------------------
OptionsMenu:
Return
StartAutoPlay:
AutoPlay:
Loop
{
GuiControlGet, SoundFile,, AutoCueList
SoundPlay, %SoundFile%, 1
If Request = Yes
{
GuiControlGet, RequestList
SoundPlay, %RequestList%, 1
GuiControl,, RequestState, %A_ScriptDir%\YellowLight.bmp
ListBoxNumber = 2
ListBoxName = AutoCueList
}
GoSub, Forward
If LoopState = OFF
{
Break
}
If LoopState = ON
{
ControlGet, SongNum, List,, ListBox1, Auto Dj v2.0
Loop, Parse, SongNum, `n
{
SongListMax = %A_Index%
}
SendMessage, 0x188, 0, 0, ListBox1, Auto Dj v2.0 ; 0x188 is LB_GETCURSEL (for a ListBox).
CurrentSongNum = %ChoicePos%
If SongListMax = %CurrentSongNum%
{
Control, Choose, 1, ListBox1, Auto Dj v2.0
}
}
If AutoPlay = No
Break
Request = No
}
Return
StopAutoPlay:
If AutoPlay = On
{
AutoPlay = Off
Return
}
If AutoPlay = Off
{
AutoPlay = On
Return
}
Return
InsertRequest:
If Request = Yes
{
Request = No
GuiControl,, RequestState, %A_ScriptDir%\RedLight.bmp
Return
}
If Request = No
{
Request = Yes
GuiControl,, RequestState, %A_ScriptDir%\GreenLight.bmp
Return
}
Return
OpenPlayList:
SavePlayList:
Return
UCLR:
ListBoxNumber = 1
ListBoxName = RequestList
Return
UCLA:
ListBoxNumber = 2
ListBoxName = AutoCueList
Return
AddSongFile:
AddFile:
FileSelectFile, SelectedFiles, M 1, %DefaultMusicPath%
If SelectedFiles =
{
return
}
Loop, parse, SelectedFiles, `n
{
StringSplit, FilelistArray, A_loopField, `.
If FileListArray2 = pk
Continue
If A_Index = 1
{
SoundPath = %A_LoopField%
}
Else
{
GuiControl,, %ListBoxName%, %A_LoopField%
}
}
Return
RemoveSongFile:
GuiControlGet, FileList,, %ListBoxName%
ControlGet, SongToRemove, FindString, %FileList%, ListBox%ListBoxNumber%, Auto Dj v2.0
Control, Delete, %SongToRemove%, ListBox%ListBoxNumber%, Auto Dj v2.0
Return
Play:
GuiControlGet, SongName,, %ListBoxName%
SoundPlay, %SongName%, 1
Return
Pause:
Return
Stop:
SoundPlay, %NoSoundFile%
Return
Forward:
SendMessage, 0x188, 0, 0, ListBox%ListBoxNumber%, Auto Dj v2.0 ; 0x188 is LB_GETCURSEL (for a ListBox).
ChoicePos = %ErrorLevel% ; It will be -1 if there is no item selected.
ChoicePos += 1 ; Convert from 0-based to 1-based, i.e. so that the first item is known as 1, not 0.
ChoicePos += 1
Control, Choose, %ChoicePos%, ListBox%ListBoxNumber%, Auto Dj v2.0
Return
Back:
SendMessage, 0x188, 0, 0, ListBox%ListBoxNumber%, Auto Dj v2.0 ; 0x188 is LB_GETCURSEL (for a ListBox).
ChoicePos = %ErrorLevel% ; It will be -1 if there is no item selected.
ChoicePos += 1 ; Convert from 0-based to 1-based, i.e. so that the first item is known as 1, not 0.
ChoicePos -= 1
Control, Choose, %ChoicePos%, ListBox%ListBoxNumber%, Auto Dj v2.0
Return
LoopToggle:
If LoopState = ON
{
GuiControl,, LoopStat, %A_ScriptDir%\LoopOff.bmp
LoopState = Off
Return
}
If LoopState = OFF
{
GuiControl,, LoopStat, %A_ScriptDir%\LoopOn.bmp
LoopState = ON
Return
}
Return
Eject:
If EStat = 0
{
Drive, Eject, %DefaultDrive% , %EStat%
EStat += 1
Return
}
If Estat = 1
{
Drive, Eject, %DefaultDrive% , %EStat%
EStat -= 1
Return
}
Return
GuiClose:
Exit:
ExitApp |
here is the whole thing, have a look _________________ my lame sig  |
|
| Back to top |
|
 |
Serenity
Joined: 07 Nov 2004 Posts: 1276
|
Posted: Wed Mar 09, 2005 11:09 pm Post subject: |
|
|
| Code: | Loop, parse, SelectedFiles, `n
{
StringSplit, FilelistArray, A_loopField, `.
If FileListArray2 = pk
Continue
If A_Index = 1
{
SoundPath = %A_LoopField%
}
Else
{
GuiControl,, %ListBoxName%, %A_LoopField%
}
}
Return |
FileListArray2? _________________ "Anything worth doing is worth doing slowly." - Mae West
 |
|
| Back to top |
|
 |
IU Guest
|
Posted: Wed Mar 09, 2005 11:27 pm Post subject: |
|
|
| yes, some wave files when saved have and associated file(filename.pk) that are a data file, even tho I can remove them from the song lists I rather them not make it there at all, so that filters them out |
|
| Back to top |
|
 |
Serenity
Joined: 07 Nov 2004 Posts: 1276
|
Posted: Wed Mar 09, 2005 11:31 pm Post subject: |
|
|
I meant the variable FilelistArray2. That variable hasn't been specified elsewhere in the script. I assume its wrong because of the line preceding- StringSplit, FilelistArray, A_loopField, `. _________________ "Anything worth doing is worth doing slowly." - Mae West
 |
|
| Back to top |
|
 |
Invalid User
Joined: 14 Feb 2005 Posts: 442 Location: Texas, Usa
|
Posted: Wed Mar 09, 2005 11:43 pm Post subject: |
|
|
you mean the difference in spelling, which doenst matter but should be fixed to prevent a bug. I see ya now _________________ my lame sig  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|