20 May '13 - 14:57 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: Bass.BASS_PluginLoad("basswma.dll")  (Read 828 times)
kio2008
Posts: 44


« on: 4 Jul '12 - 20:38 »
Reply with quoteQuote

Hi everyone,
i must download 2 internet radio inside 2 distinct threads. These radio are MMS type, i must load for each thread Plugin basswma.dll ?
Or i must load only for the first thread basswma.dll ?

Thank you
Logged
Ionut Cristea
Posts: 1372


« Reply #1 on: 4 Jul '12 - 21:15 »
Reply with quoteQuote

 ONly one time, any other atempts will not succeed anyway.
Logged
kio2008
Posts: 44


« Reply #2 on: 5 Jul '12 - 07:46 »
Reply with quoteQuote

I have main form that start these 2 threads. I must load plug in one time inside main form o inside the first or the second thread ?
Logged
Ian @ un4seen
Administrator
Posts: 15244


« Reply #3 on: 5 Jul '12 - 13:56 »
Reply with quoteQuote

The BASS_PluginLoad call can be made in any thread.
Logged
kio2008
Posts: 44


« Reply #4 on: 5 Jul '12 - 22:04 »
Reply with quoteQuote

Administrator, can you confirm that i must load call bass_plugin only one time if i have two download internet radio ?

And, if i unload basswma for the first internet radio it unload for the second internet radio too ?
Logged
radio42
Posts: 4012


« Reply #5 on: 6 Jul '12 - 09:08 »
Reply with quoteQuote

All BASS functions are 'static'!
As such it doesn't really matter in which thread (either the UI thread or any other thread you call those function).
Except for "BASS_Init", which should be called in the main UI Thread.

However, good practice is to invoke all your one-time things in the main UI thread at the beginning  of the application (like initializing the audio device, loading any plugins, setting any BASS config options etc.).
Once all this is done, you might create any number of (worker) threads to perform any kind of processing.
E.g. calling BASS_StreamCreateURL multiple times for different streams might easily go into dedicated threads.
Logged
Ian @ un4seen
Administrator
Posts: 15244


« Reply #6 on: 6 Jul '12 - 15:54 »
Reply with quoteQuote

Administrator, can you confirm that i must load call bass_plugin only one time if i have two download internet radio ?

And, if i unload basswma for the first internet radio it unload for the second internet radio too ?

Yes to both questions. If you call BASS_PluginLoad multiple times with the same DLL (eg. BASSWMA.DLL), the extra calls will fail with a BASS_ERROR_ALREADY error. And if you call BASS_PluginFree to unload a plugin, all streams that are using that plugin will automatically be freed.
Logged
kio2008
Posts: 44


« Reply #7 on: 9 Jul '12 - 20:21 »
Reply with quoteQuote

Thank you very much for your informations.
I have another question, if I have two internet radio so :

the first radio is wma type and
the second radio is aac type,

i must load wma and aac plugin both ?
on main form ? or wma plugin inside first thread that download the first radio and aac plugin inside the second thread that download the second radio ?

Logged
Ian @ un4seen
Administrator
Posts: 15244


« Reply #8 on: 10 Jul '12 - 15:07 »
Reply with quoteQuote

Yes, if you want to play WMA and AAC streams, then you will need to load both BASSWMA and BASS_AAC (unless Media Foundation codecs are available). As mentioned earlier, it doesn't really matter what thread you make the BASS_PluginLoad calls in. I would suggest loading the required plugins once during initialization and then just leaving them loaded, ie. don't bother with BASS_PluginFree.
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines