Old 17th March 2011, 23:28   #1
.Korabel.
Junior Member
 
Join Date: Mar 2011
Posts: 3
Set plugin properties programmatically

I uses input plugin directly and it works fine. How i may read and set his properties(input/output device for example). Call config() and sets it by handles saves it only for current app session. Winamp makes what i need,it saves settings in registry and loadnset later,but how it does this. Thanx
.Korabel. is offline   Reply With Quote
Old 17th March 2011, 23:51   #2
DrO
 
Join Date: Sep 2003
Posts: 27,873
what? your post really doesn't make too much sense. what input plug-in - is it something you've made yourself or trying to re-use?

-daz
DrO is offline   Reply With Quote
Old 18th March 2011, 00:20   #3
.Korabel.
Junior Member
 
Join Date: Mar 2011
Posts: 3
ok, i use in_midi.dll and need select midiout device. How i may do this?
.Korabel. is offline   Reply With Quote
Old 18th March 2011, 10:09   #4
DrO
 
Join Date: Sep 2003
Posts: 27,873
by using the config dialog and working out what you want that way though trying to re-use a Winamp in another program (as it sounds like you're trying to do) is going to cause you more issues than making a native plug-in for whatever you're trying to use it in.

-daz
DrO is offline   Reply With Quote
Old 18th March 2011, 14:35   #5
.Korabel.
Junior Member
 
Join Date: Mar 2011
Posts: 3
Look this example

typedef InModule* (*tInMod)(void)
tInMod waGIM2=NULL;
InModule* midi_plugin=NULL;
char devicenum=0;

// Load plugin
HINSTANCE h=LoadLibrary("in_midi.dll");
// Import func
waGIM2=(tinmod)GetProcAddress(h,"winampGetInModule2");
// Gets plugin interface
midi_plugin=waGIM2();
// Initialize plugin
midi_plugin->Init();
// Open simple config file
// File contains only 1 byte - number of midi device
FILE* f=fopen("config.cfg","rb");
// Success,config file present and we must read device number
if(f)
{
fread(&devicenum,1,1,f));
fclose(f);
// Now we must set plugin midi output device,but how
// .........
// .........
}
else
{
// Config file not present
midi_plugin->Config();
// Plugin configured,now we must get settings from plugin,but how?
// ...........
// ...........
// Save settings to our config file
FILE* f=fopen("config.cfg","wb");
fwrite(&devicenum,1,1,f);
fclose(f);
}

// Playing midi file
midi_plugin->Play("somefile.mid");
int filetime=midi_plugin->GetFileTime();
Sleep(filetime);
midi_plugin->Quit();
.Korabel. is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump