PDA

View Full Version : Media player plugin available for girder 4



birty
January 28th, 2005, 01:38 PM
this is my first attempt to use DUI so it might not be perfect
http://www.birtles.org.uk/girder/CTMediaSetup2.8.exe
the setup also contains a DUI unit ported to delphi so if you are trying to develop a delphi plugin it might help

Ron
January 28th, 2005, 02:52 PM
Congratulations, you are the first 3rd party plugin!

birty
January 28th, 2005, 02:55 PM
wohooo, do i get a prize? :wink:

Ron
January 28th, 2005, 02:55 PM
:-)

birty
January 28th, 2005, 05:13 PM
now that i have the dui working, how do i make my settings screen part of the dui (im sure i read somewhere it was possible)
edit: i assume its pretty much the same as with command except you look for duOnHookConfig in gir_dynamic_ui, but how do you get the settings back into the plugin from the dui?

curtiswren
February 25th, 2005, 10:49 PM
Did you figure out how to do this? I need to do the same thing. I've got the screen showing up in the settings dialog, but I'm not sure how to prefill it or get the settings when the apply button is pressed.

On a related note, how do we do similar things for a learn event dialog?

birty
February 26th, 2005, 03:44 AM
you need to create an xml file using the dui designer but more than that i dont know

Ron
February 27th, 2005, 04:19 PM
For the settings window basically you specify registry number or registry value. Look at plugins\UI\UIR.xml for an example. So set the registry to whatever default you plugin needs if there is nothing in there. When the user presses apply on that dialog you get a 'duOnApply' callback into the gir_dynamic_ui.

Sadly we don't have the DUI in place for the events. To prevent G4 from moving futher out into the future we decided not to implement that for the current release.

birty
April 21st, 2005, 10:40 AM
new version released with lots of changes:

http://www.birtles.org.uk/girder/CTMediaSetup2.9.exe

settings are saved when you close the setup screen rather than when girder is closed
volume can be changed by a variable amount
fast forward/rewind can be done by a variable number of seconds
option to realod the current track
fastforward and rewind works properly now
fixed error when clicking on menu title
menu can be navigated with numbers
menu size configurable
lua scripting (see CTMedia Lua.html in the manual directory for details) functions for editing the media library my be coming soon

birty
April 21st, 2005, 10:46 AM
a small suggestion a standard format for documentation for plugins that add lua functions could be useful so that all the documentation looks the same

Promixis
April 21st, 2005, 12:07 PM
We have a tech writer doing that :D

Mark F
April 21st, 2005, 12:19 PM
Can we lowly developers ;) get a template to use so our documents can have an opportunity to look somewhat like Promixis documents? I wouldn't think you want your tech writer doing our documents, too. Or do you?

Promixis
April 21st, 2005, 01:47 PM
We will have our writter do whatever you want :D Okay, within reason :lol:

We are greatful for any contribution to G and NR.

birty
June 4th, 2005, 05:02 AM
version 2.10 released
changes:
Removed dependancy on wingdings 3 font
Silence detection and scipping
Partial integration of config screen into DUI
OSD example GML added
http://www.birtles.org.uk/girder/CTMediaSetup2.10.exe

birty
July 6th, 2005, 02:31 PM
version 2.11 released
changes:
-M3U and PLS playlist support
-Menu now uses Girder's OSD
-Further integration of config screen into Girder

http://www.birtles.org.uk/girder/CTMediaSetup2.11.exe

birty
July 8th, 2005, 01:32 PM
version 2.12 released
changes:
-Girder OSD now used for main OSD
-Config screen completely integrated into Girder
-Original config screen removed

http://www.birtles.org.uk/girder/CTMediaSetup2.12.exe

Ron
July 8th, 2005, 02:16 PM
> Girder OSD now used for main OSD

Does that mean the lua osd?

birty
July 8th, 2005, 02:18 PM
yes it does

Ron
July 8th, 2005, 02:19 PM
GREAT :-)

birty
July 13th, 2005, 07:48 AM
We will have our writter do whatever you want :D Okay, within reason :lol:

We are greatful for any contribution to G and NR.
does this offer still stand? if so could i have the attached help file translated into the standard format (no rush)

Promixis
July 13th, 2005, 08:47 AM
Sure, remind me once we get the G4 manual done and I will see if John still has enough cycles left to add this.

birty
July 18th, 2005, 03:16 PM
is the documentation written in latex? if so it may be easier to supply a latex template so developers can make their own documentation

Ron
July 18th, 2005, 03:20 PM
OpenOffice.

birty
July 18th, 2005, 03:22 PM
i just assumed latex as you managed to easily produce both html and pdf versions

Ron
July 18th, 2005, 03:25 PM
Yeah, it does seem like latex in that way.

Ron
July 18th, 2005, 03:26 PM
Nostalgia, I haven't used latex since my thesis. Aah the good ol' days of 2 dimensional flow patterns in plasma. *shudders*.

Rob H
July 18th, 2005, 03:32 PM
Tut, tut - canonically the orthography is LaTeX !!!

Another former LaTeX user

birty
July 24th, 2005, 03:22 PM
version 2.13 released
changes:
-Integrated LUA volume osd
-Fixed database location and m3u directory not being saved
-Fixed statup errors causing plugin not to initialise properly
-Reduced DLL size
-Fixed Girder crashes when using multiple plugin osds
-Silence skipping is now disabled when output volume is set to 0
-Added additional lua functions and updated LUA documentation
-Track osd position is now saved
-Fixed menu up command performing menu down action
-Fixed random not being disabled when skipping to an album

http://www.birtles.org.uk/girder/CTMediaSetup2.13.exe

birty
September 8th, 2005, 12:31 PM
version 2.14 released
changes:
-Fixed bug causing mutliple settings windows to be shown
-Changed lua manual to match girder formatting
-Fixed selecting previous doing next
-Changed DUI to Girder 4 Beta 8
-Added lua function to set the output device

http://www.birtles.org.uk/girder/CTMediaSetup2.14.exe

quixote
September 21st, 2005, 03:32 PM
Birty, could I persuade you to implement one more feature please?
Maybe I've failed to find it, but I could not find any commands to play just one .wav or .MP3. I'd like to be able to play a sound over the output device of my choice, but not need a playlist file for it. Is this possible? Something like the win.playsound LUA command, but with your plugin. Then you could have the search for play list directories at startup optional or not search if nil.

Thanks for considering it.

birty
September 21st, 2005, 03:34 PM
i finish work on friday so i may have a look at the weekend

quixote
September 21st, 2005, 06:00 PM
Thanks. I really appreciate it. My multizone audio system is in place outside my front door, and I'm setting up a "front door answering machine" for when I'm sleeping or not around. :D

quixote
September 21st, 2005, 09:20 PM
Looking at the LUA functions again while I try to organize my alarm system, I noticed that there's no LUA function for balance either. :oops: I know I'm asking for a lot, but it really would be useful.

birty
September 24th, 2005, 06:27 AM
how do i implement a callback in delphi/c ? i want to be able to pass a lua function to a function in my plugin and when the function is complete call the callback (ie start playing a file and call the callback when the file ends)

birty
September 24th, 2005, 07:12 AM
version 2.15 released
changes:
-Added lua function to play a file
-Added lua functions to set the output pan

http://www.birtles.org.uk/girder/CTMediaSetup2.15.exe

quixote
September 24th, 2005, 12:50 PM
Thanks Birty!

Update: I just tried using this line and it doesn't work. I could not find an updated documment with the new syntax.



CTMedia:PlayFile ("D:\\Audio\\Sounds\\lockdown.wav")

Could you please let me know how I should be doing this? Thank you.

birty
September 24th, 2005, 05:15 PM
i did update the document, but the problem there is you used a colon instead of a dot it should be

CTMedia.PlayFile ("D:\\Audio\\Sounds\\lockdown.wav")

quixote
September 24th, 2005, 05:55 PM
:oops:

Thank you, sir.

Update: I still can't get it to work. Is there anything else I need to do before it will work?

birty
September 25th, 2005, 01:37 AM
is anything displayed in the lua console? or in c:\mediaplayer.log

quixote
September 25th, 2005, 02:10 AM
nothing is displayed in the LUA console, but my .log file gives me this:

02:31:05 : +==================================+
02:31:05 : | LOG STARTED |
02:31:05 : +==================================+
02:31:05 : Loading...
02:31:05 : Loading DUI
02:31:05 : Done loading DUI
02:31:05 : Config Form Created
02:31:05 : Display Form Created
02:31:05 : Config's form vars set
02:31:05 : Loading config..
02:31:05 : Reading dui config
02:31:05 : Getting lua mutex, mcount=0, got=0
02:31:05 : Failed to get lua mutex
02:31:05 : End get lua mutex, mcount=0, got=0
02:31:05 : Getting lua mutex, mcount=0, got=0
02:31:06 : Failed to get lua mutex
02:31:06 : End get lua mutex, mcount=0, got=0
02:31:07 : Config loaded
02:31:07 : Done Loading
02:31:07 : Girder DUI 0
02:31:07 : Girder DUI 9
02:31:07 : Girder DUI 11
02:31:07 : Girder DUI 17
02:31:09 : Gir Info 7
02:31:09 : Could not load ctosd.lua



BTW, I am using my D drive as my main drive. That doesn't matter, does it?

birty
September 25th, 2005, 02:19 AM
is the ctosd file present in the luascript directory? also are you using beta 8

quixote
September 25th, 2005, 02:31 AM
affirmative. (to both questions)

birty
September 25th, 2005, 03:29 AM
try this one it should put the error code in the log file when it loads the file

quixote
September 25th, 2005, 08:01 AM
Here is the log file:


08:50:13 : +==================================+
08:50:13 : | LOG STARTED |
08:50:13 : +==================================+
08:50:13 : Loading...
08:50:13 : Loading DUI
08:50:13 : Done loading DUI
08:50:13 : Config Form Created
08:50:13 : Display Form Created
08:50:13 : Config's form vars set
08:50:13 : Loading config..
08:50:13 : Reading dui config
08:50:13 : Getting lua mutex, mcount=0, got=0
08:50:13 : Failed to get lua mutex
08:50:13 : End get lua mutex, mcount=0, got=0
08:50:13 : Getting lua mutex, mcount=0, got=0
08:50:13 : Failed to get lua mutex
08:50:13 : End get lua mutex, mcount=0, got=0
08:50:17 : Cannot open file "C:\Documents and Settings\All Users\Application Data\Creative\Media Database\album.dbf". The system cannot find the path specified
08:50:17 : Done Loading
08:50:17 : Girder DUI 0
08:50:17 : Girder DUI 9
08:50:17 : Girder DUI 11
08:50:17 : Girder DUI 17
08:50:20 : Gir Info 5
08:50:21 : Gir Info 7
08:50:21 : Could not load ctosd.lua: 1,
08:50:48 : Getting lua mutex, mcount=0, got=0
08:50:48 : Failed to get lua mutex
08:50:48 : End get lua mutex, mcount=0, got=0

birty
September 25th, 2005, 08:54 AM
weird, that seems to indicate it cant find the script file, try this one:

quixote
September 25th, 2005, 12:13 PM
YES! IT WORKS! :D

Thanks!

birty
September 25th, 2005, 12:16 PM
do the osd work though? it probably only works because i changed it so that if the osd failed to load then the lua functions still work

quixote
September 25th, 2005, 01:08 PM
Oh. :(

I tried:

CTOSD.Toggle()

and it doesn't work. The global CTOSD is nil.

birty
September 25th, 2005, 01:23 PM
the full path to the script should now be shown in the log, is it correct?

quixote
September 25th, 2005, 02:01 PM
Here is my Log file:


13:07:23 : +==================================+
13:07:23 : | LOG STARTED |
13:07:23 : +==================================+
13:07:23 : Loading...
13:07:23 : Loading DUI
13:07:23 : Done loading DUI
13:07:23 : Config Form Created
13:07:23 : Display Form Created
13:07:23 : Config's form vars set
13:07:23 : Loading config..
13:07:23 : Reading dui config
13:07:26 : Config loaded
13:07:26 : Done Loading
13:07:26 : Girder DUI 0
13:07:26 : Girder DUI 9
13:07:26 : Girder DUI 11
13:07:26 : Girder DUI 17
13:07:28 : Gir Info 7
13:07:28 : Could not load D:\Program Files\Promixis\Girder\luascript\CTOSD.lua: 1,
13:11:58 : Gir Info 5
13:12:08 : Getting lua mutex, mcount=0, got=0
13:12:08 : End get lua mutex, mcount=1, got=1
13:12:08 : Lua PlayFile
13:12:08 : Playing lockdown.wav
13:12:08 : Releasing lua mutex, mcount=1, got=1
13:12:08 : End release lua mutex, mcount=0, got=0
13:18:04 : Getting lua mutex, mcount=0, got=0
13:18:04 : End get lua mutex, mcount=1, got=1
13:18:04 : Lua PlayFile
13:18:04 : Playing tngchime.wav
13:18:04 : Releasing lua mutex, mcount=1, got=1
13:18:04 : End release lua mutex, mcount=0, got=0
13:37:02 : Gir Info 10
13:37:33 : Gir Info 10
13:42:43 : Gir Info 10
13:43:44 : Gir Info 10
13:47:50 : Gir Info 10
13:52:44 : Gir Info 10
13:53:45 : Gir Info 10
13:56:51 : Gir Info 10
13:57:48 : Gir Info 10
14:03:05 : Gir Info 10
14:09:15 : Gir Info 10
14:10:23 : Gir Info 10
14:14:06 : Gir Info 10
14:15:23 : Gir Info 10
14:18:34 : Gir Info 10
14:21:30 : Gir Info 10
14:27:13 : Gir Info 10
14:33:00 : Gir Info 10
14:33:43 : Gir Info 10
14:54:11 : Gir Info 10
14:54:50 : Gir Info 10

birty
September 25th, 2005, 02:03 PM
and "D:\Program Files\Promixis\Girder\luascript\CTOSD.lua" definately exists? i think i will need help from Ron on this one, this is the code i'm using if it helps

top:=lua_gettop(Ls);
LuaL_OpenLib(ls,'CTMedia',@(CTLua_Funcs[0]),0);
osdscript:=main.support.CoreVars.ExePath+'luascrip t\CTOSD.lua';
res:=lua_dofile(ls,pchar(osdscript));
if res<>0 then begin
if lua_isstring&#40;ls,-1&#41; then err&#58;=lua_tostring&#40;ls,-1&#41;
else err&#58;='';
addeventfmt&#40;'Could not load %s&#58; %d, %s',&#91;osdscript,res,err&#93;&#41;;
end;
Lua_SetTop&#40;ls,top&#41;;

quixote
September 25th, 2005, 02:28 PM
Yes, it's there.

Ron
September 25th, 2005, 05:41 PM
The scripts in the luascript directory are loaded automatically, you should not load them manually. What seems to be the problem?

birty
September 25th, 2005, 05:48 PM
dunno, it works for me but quixote seems to be having problems, i dont put the scripts in the startup directory so that they are only loaded when the plugin is loaded. on quixote's installation lua_dofile is returning LUA_ERRRUN which as far as i can gather means that lua simply couldn't load the specified file

Ron
September 25th, 2005, 05:52 PM
Ignore my last comment, I was thinking of the treescript directory.

Don check if you are starting Girder in the correct directory. So check if on the properties page for the shortcut of Girder the "start in" box is set to the correct directory.

quixote
September 25th, 2005, 06:33 PM
I recreated my shortcut and made sure that it starts in "D:\Program Files\Promixis\Girder", where it's default install is. Unfortunately, it still does not work.

Birty, does it matter that I have not specified a library directory? I get the message everytime I start up, but I not being a user of MediaPlayer usually, I don't know which directory it is.

birty
September 26th, 2005, 01:34 AM
it shouldn't do, you could try creating a small library using my database editor

quixote
September 26th, 2005, 09:13 AM
OK, I'll try it out later. Is there no one else here that has been having a similar problem as I am? Please speak up if so. I'm really perplexed now. All of my other startup scripts seem to run fine.

birty
September 26th, 2005, 09:15 AM
i dont know that very many people are using the plugin

quixote
September 26th, 2005, 09:38 AM
That's a shame. It seems like it would be really great, if I could only get it working on my system.

Ron
September 26th, 2005, 10:18 AM
How about this.
Let's get rid of the dofile, and try this code. It splits the load up in two steps and gives you an error feedback.



BOOL RunScript&#40;lua_State *L, char * filename &#41;
&#123;
int n;
const char *e, *r;

n = 0;
if &#40; luaL_loadfile&#40;L, filename&#41; != 0 &#41;
&#123;
e = lua_tostring&#40;L,-1&#41;;
luaprint&#40;L, e, "TreeScript &#40;RunScript 1&#41;&#58; "&#41;;
lua_pop&#40;L,1&#41;;
return FALSE;
&#125;
else
&#123;

lua_pushstring&#40;L,"_TRACEBACK"&#41;;
lua_gettable&#40;L, LUA_GLOBALSINDEX&#41;;
lua_insert&#40;L, -n-2&#41;;

if &#40; lua_pcall&#40;L,n,0,-n-2&#41; != 0 &#41;
&#123;
e = lua_tostring&#40;L,-1&#41;;
luaprint&#40;L, e, "TreeScript &#40;RunScript 2&#41;&#58; "&#41;;
lua_pop&#40;L,2&#41;; // error + traceback.
return FALSE;
&#125;


lua_pop&#40;L,1&#41;; // traceback.
&#125;

return TRUE;
&#125;

birty
September 26th, 2005, 10:31 AM
try this one

Ron
September 26th, 2005, 10:46 AM
In case you need luaprint.


void luaprint&#40;lua_State*L, const char * str, const char * from&#41;
&#123;
lua_pushstring&#40;L, "print"&#41;;
lua_gettable&#40;L, LUA_GLOBALSINDEX&#41;;
if &#40; from != NULL &#41;
&#123;
lua_pushstring&#40;L, PCHAR&#40;from&#41;&#41;;
lua_pushstring&#40;L, PCHAR&#40;str&#41;&#41;;
lua_call&#40;L, 2,0&#41;;
&#125;
else
&#123;
lua_pushstring&#40;L, PCHAR&#40;""&#41;&#41;;
lua_pushstring&#40;L, PCHAR&#40;str&#41;&#41;;
lua_call&#40;L, 2,0&#41;;
&#125;
&#125;

quixote
September 26th, 2005, 12:44 PM
I'll try that file as soon as I get home from work. Thanks.

Update: It still doesn't work, but here's my new MediaPlayer.log:


17&#58;26&#58;54 &#58; +==================================+
17&#58;26&#58;54 &#58; | LOG STARTED |
17&#58;26&#58;54 &#58; +==================================+
17&#58;26&#58;54 &#58; Loading...
17&#58;26&#58;54 &#58; Loading DUI
17&#58;26&#58;54 &#58; Done loading DUI
17&#58;26&#58;54 &#58; Config Form Created
17&#58;26&#58;54 &#58; Display Form Created
17&#58;26&#58;54 &#58; Config's form vars set
17&#58;26&#58;54 &#58; Loading config..
17&#58;26&#58;54 &#58; Reading dui config
17&#58;26&#58;56 &#58; Config loaded
17&#58;26&#58;56 &#58; Done Loading
17&#58;26&#58;56 &#58; Girder DUI 0
17&#58;26&#58;56 &#58; Girder DUI 9
17&#58;26&#58;56 &#58; Girder DUI 11
17&#58;26&#58;56 &#58; Girder DUI 17
17&#58;26&#58;59 &#58; Gir Info 7
17&#58;26&#58;59 &#58; Error running D&#58;\Program Files\Promixis\Girder\luascript\CTOSD.lua - D&#58;\Program Files\Promixis\Girder\luascript\CTOSD.lua&#58;1&#58; cannot find startup\osd in path D&#58;\Program Files\Promixis\Girder\luascript\?.lua
stack traceback&#58;
&#91;C&#93;&#58; in function `error'
...gram Files\Promixis\Girder\\luascript\compat-5.1.lua&#58;64&#58; in function `require'
D&#58;\Program Files\Promixis\Girder\luascript\CTOSD.lua&#58;1&#58; in main chunk
17&#58;27&#58;20 &#58; Gir Info 5
17&#58;29&#58;46 &#58; Getting lua mutex, mcount=0, got=0
17&#58;29&#58;46 &#58; End get lua mutex, mcount=1, got=1
17&#58;29&#58;46 &#58; Lua PlayFile
17&#58;29&#58;46 &#58; Playing lockdown.wav
17&#58;29&#58;46 &#58; Releasing lua mutex, mcount=1, got=1
17&#58;29&#58;46 &#58; End release lua mutex, mcount=0, got=0

birty
September 26th, 2005, 04:54 PM
have you removed osd.lua from the startup direcotry? (or has it moved ron?)

Ron
September 26th, 2005, 04:55 PM
osd has moved into the /luascript directory. We are trying to keep the startup directory only for stuff that actually needs this.

birty
September 26th, 2005, 05:02 PM
in that case quixote change the firt line in ctosd to
[code]require("osd.lua");[code]
and it should work

Rob H
September 26th, 2005, 05:06 PM
Strictly speaking, the .lua is unnecessary there

quixote
September 26th, 2005, 05:18 PM
in that case quixote change the firt line in ctosd to
[code]require("osd.lua");[code]
and it should work

No dice.

&#91;code&#93;18:15:32 : +==================================+
18:15:32 : | LOG STARTED |
18:15:32 : +==================================+
18:15:32 : Loading...
18:15:32 : Loading DUI
18:15:32 : Done loading DUI
18:15:32 : Config Form Created
18:15:32 : Display Form Created
18:15:32 : Config's form vars set
18:15:32 : Loading config..
18:15:32 : Reading dui config
18:15:33 : Error finding . Media error:Invalid Artist Name
18:15:33 : Config loaded
18:15:33 : Done Loading
18:15:33 : Girder DUI 0
18:15:33 : Girder DUI 9
18:15:33 : Girder DUI 11
18:15:33 : Girder DUI 17
18:15:35 : Gir Info 7
18:15:35 : Error running D:\Program Files\Promixis\Girder\luascript\CTOSD.lua - D:\Program Files\Promixis\Girder\luascript\CTOSD.lua:1: cannot find osd.lua in path D:\Program Files\Promixis\Girder\luascript\?.lua
stack traceback:
[C]: in function `error'
...gram Files\Promixis\Girder\\luascript\compat-5.1.lua:64: in function `require'
D:\Program Files\Promixis\Girder\luascript\CTOSD.lua:1: in main chunk
18:15:51 : Gir Info 5
18:16:30 : Getting lua mutex, mcount=0, got=0
18:16:30 : End get lua mutex, mcount=1, got=1
18:16:30 : Lua PlayFile
18:16:30 : Playing lockdown.wav
18:16:30 : Releasing lua mutex, mcount=1, got=1
18:16:30 : End release lua mutex, mcount=0, got=0
&#91;/code&#93;

Ron
September 26th, 2005, 05:29 PM
change to:


require&#40;"osd"&#41;;

quixote
September 26th, 2005, 05:42 PM
:(


18&#58;40&#58;33 &#58; +==================================+
18&#58;40&#58;33 &#58; | LOG STARTED |
18&#58;40&#58;33 &#58; +==================================+
18&#58;40&#58;33 &#58; Loading...
18&#58;40&#58;33 &#58; Loading DUI
18&#58;40&#58;33 &#58; Done loading DUI
18&#58;40&#58;33 &#58; Config Form Created
18&#58;40&#58;33 &#58; Display Form Created
18&#58;40&#58;33 &#58; Config's form vars set
18&#58;40&#58;33 &#58; Loading config..
18&#58;40&#58;33 &#58; Reading dui config
18&#58;40&#58;34 &#58; Error finding . Media error&#58;Invalid Artist Name
18&#58;40&#58;34 &#58; Config loaded
18&#58;40&#58;34 &#58; Done Loading
18&#58;40&#58;34 &#58; Girder DUI 0
18&#58;40&#58;34 &#58; Girder DUI 9
18&#58;40&#58;34 &#58; Girder DUI 11
18&#58;40&#58;34 &#58; Girder DUI 17
18&#58;40&#58;36 &#58; Gir Info 7
18&#58;40&#58;52 &#58; Gir Info 5

Ron
September 26th, 2005, 05:43 PM
looks to me like the osd file is loaded.

quixote
September 26th, 2005, 05:55 PM
Alas, when I try the code
CTOSD.Toggle&#40;&#41;, it does nothing but give me errors in the console telling me that I'm trying to index a nil table; CTOSD.

birty
September 26th, 2005, 06:16 PM
that should be CTOSD:Toggle

quixote
September 26th, 2005, 06:31 PM
I'm afraid that I tried that already.

birty
September 26th, 2005, 06:33 PM
is the variable in the variable inspector (you do realise its in the ctmedia table dont you?), alos you can toggle the osd from the action tree, there is a ct media action in the girder group

quixote
September 26th, 2005, 06:41 PM
Ah, ok, I see that the CTOSD is now loaded. before I could only see the main functions listed in the variable display. Also, the command works from the action tree, but not LUA.

birty
September 26th, 2005, 06:42 PM
the full command should be:

CTMedia.CTOSD&#58;Toggle&#40;&#41;

quixote
September 26th, 2005, 06:45 PM
arrrgggh

CTMedia.CTOSD:Toggle ()

just figured it out seconds before I saw your post. :)

Thanks!

quixote
September 26th, 2005, 07:34 PM
I think the command:

CTMedia.PlayFile &#40;"D&#58;\\Audio\\Sounds\\lockdown.wav"&#41;
confused me a little about the table structure. I thought that CTOSD was another table. I should have looked at the variable inspector sooner, plus I just noticed at the top of the HTML help file it says
All of the following functions can be found in the "CTMedia" table, they are only available when the "Creative Media Player" plugin is loaded.
, but I think that maybe you should put it in a larger font like the blue commands because it is very easy to miss. All I saw when quickly scanning for the command was

CTOSD:Toggle()
Hides the OSD if it is showing, otherwise the OSD is shown.
and I assumed that the table was CTOSD. I'm awfully sorry for the inconvenience that I caused. :oops:

Can you please direct me to the updated help file? I can't seem to find it and it would not show on installation. I need to figure out how to change output devices, and I can't see the function in the variable inspector.

birty
September 26th, 2005, 07:37 PM
it should have been installed in the manual directory, its called CTMedia Lua.html

quixote
September 26th, 2005, 07:38 PM
just found it. Thanks!

This is much more clear than the other help file that I had.
I had to rename the last one to an .html file to view it. Probably something else that I missed. :-?

birty
September 27th, 2005, 07:13 AM
version 2.15.1 released
changes:
-Changed path to osd.lua in ctosd.lua

http://www.birtles.org.uk/girder/CTMediaSetup2.15.1.exe

birty
September 29th, 2005, 11:31 AM
how do i implement a callback in delphi/c ? i want to be able to pass a lua function to a function in my plugin and when the function is complete call the callback (ie start playing a file and call the callback when the file ends)
any ideas?

Ron
September 29th, 2005, 11:35 AM
int cb;

// function is at top of stack.
if &#40; lua_isfunction&#40;L,4&#41; &#41;
&#123;
cb = luaL_ref&#40;L, LUA_REGISTRYINDEX&#41;;
&#125;
else
cb = LUA_NOREF;


unreffing:



if &#40; cb != LUA_NOREF&#41;
lua_unref&#40;L,cb&#41;;


running:



lua_rawgeti&#40;L, LUA_REGISTRYINDEX, cb&#41;;
lua_pcall&#40;L, 0,0,0&#41;

birty
September 30th, 2005, 05:56 AM
version 2.15.2 released
changes:
-Play File callback enabled
-Changed to using Girder logging for errors

http://www.birtles.org.uk/girder/CTMediaSetup2.15.2.exe

quixote
October 1st, 2005, 08:17 PM
Hi Birty. Thanks for the update.
I just can't figure out how to change the balance yet. I read this in the manual:



Set the output pan:
[CurrentPan] = CTMedia.SetPan([Pan])

Pan: Number 0..255. Value to set the pan to
CurrentPan: Number 0..255. The pan after applying the change
A pan of 0 is all the way to the left, 128 is in the middle and 255 is all the way to the right


but can you please give me a code example of panning all the way right, then panning all the way to the left, and then back to center? I'm sure it's a minor detail that I'm missing.

birty
October 2nd, 2005, 03:08 AM
--pan to the left
CTMedia.SetPan&#40;0&#41;
--pan to the right
CTMedia.SetPan&#40;255&#41;
--return to the centre
CTMedia.SetPan&#40;128&#41;

quixote
October 2nd, 2005, 09:51 AM
ah ha. Ok, thanks. I was wondering why there was an equation there

&#91;CurrentPan&#93; = CTMedia.SetPan&#40;&#91;Pan&#93;&#41;
It looked to me like I need to have to numbers in there from 0 to 255.

birty
October 2nd, 2005, 09:57 AM
the funciton returns the current value of pan, eg if you say setpan(256) it will return 255 as the actual value the pan was set to

quixote
October 2nd, 2005, 10:17 AM
It doesn't seem to work for me. I ran a test on the speakers that I'm using with my second sound device and the speakers turn out to be "back left" and "back right" for some reason, but I guess that's a hardware problem rather than the plugin.

birty
October 2nd, 2005, 10:19 AM
i might not be using the library correctly

quixote
October 2nd, 2005, 10:22 AM
Well, I need a new sound card because I'm using a really old one, so don't get too worried.
I'll do some more tests.

quixote
October 2nd, 2005, 10:44 AM
I don't think it's working, beacuse I was able to get sound from the front left and right, the center and the rear left and right using winamp and a WAV file that fearthedentist directed me to, but was unable to pan to either side using the plugin.
Sorry it took me so long to find this.

birty
October 2nd, 2005, 10:46 AM
you mean you are using a 4 channel wave file? im not sure that is supported in fmod

quixote
October 2nd, 2005, 11:06 AM
I'm only using it to test my speakers. I can't pan just to the left or right with any other WAV, either. Ok, let me just be sure that the wavs that I'm using are in fact stereo and I will get back to you.

quixote
October 3rd, 2005, 04:38 PM
Bad news. The panning does not work. Can anyone else confirm?

birty
October 3rd, 2005, 04:45 PM
you notice no difference at all? are any errors displayed?

quixote
October 3rd, 2005, 04:57 PM
There is no difference at all. There aren't any error messages either, but it does show "Media Player Balance 0%" and "Media Player Balance 100%" on the OSD when I try panning left and right.

birty
November 3rd, 2005, 06:05 PM
anyone using my mediaplayer plugin with the latest beta should remove the line require("osd")
from ctosd.lua as it is no longer nescesarry and will cause the plugin osds to stop working, Ron it would be nice if these sort of changes were in the list of changes in a new release, took me a while to figure out why all my osds had suddenly stopped working

quixote
December 12th, 2005, 09:16 AM
Birty, did you ever have the time to look into the panning feature? I have an external/internal speaker all setup as left and right channels so that I can use it for certain sounds that don't require stereo, but need to be played in eitehr outside or inside. It would be really cool if I could have this tool to work with over my Christmas vacation. Sorry to trouble you.

birty
December 12th, 2005, 09:18 AM
theres very little i can do about it, all i can suggest is that you try updating the sound card drivers, i could try some different options in fmod and see if that helps

quixote
December 12th, 2005, 09:24 AM
Whatever you can do would be much appreciated. The sound device I am using for the "multizone audio" is built onto the motherboard of my computer. Not sure if that would involve flashing my BIOS, but I'd prefer not to if I don't have to.

birty
January 14th, 2006, 05:23 PM
i sort of forgot about this one sorry, better late than never!
added some new lua functions,
1. CTMedia.SetDriver
takes one parameter which is the output driver to use
0=No Sound
1=windows multi media (default)
2=direct sound
3=a3d (only works on a few sound cards)
7=asio

2. CTMedia.SetHW
turn on or off hardware acceleration (only takes effect next time you load a file), is off by default. takes one parameter, true to turn on hw acceleration false to turn it off