Changeset 20871

Show
Ignore:
Timestamp:
09/26/07 14:49:39 (1 year ago)
Author:
patrick
Message:

Added snx::sonix::shutdownAPI() so that user-level code has an opportunity
to control when the sound API is shut down. Previously, this only happend in
the snx::sonix destructor, a function that is only invoked when the snx::sonix
singleton is destroyed. Technically, user-level code could have used
snx::sonix::changeAPI() to switch to the "Stub" sound implementation, but that
does not exactly have the desired outcome in my opinion.

This change allows for the VR Juggler Sound Manager to shut down Sonix so that
crash-on-exit problems in the Sonix plug-ins can be fixed. The issues with
Audiere and OpenAL seemed to be tied to threading. More specifically, the
sound APIs are created and initialized in the kernel control loop thread, but
they were destroyed in the primordial thread at the time of application exit.
Now, the Sound Manager can shut Sonix down from within the kernel control loop
thread.

Bumped the version to 1.3.6.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/modules/sonix/ChangeLog

    r20865 r20871  
    11DATE        AUTHOR      CHANGE 
    22----------- ----------- ------------------------------------------------------- 
     3Sep-26-2007 patrick     Added snx::sonix::shutdownAPI() so that user-level code 
     4                        can control when the sound API is closed rather than 
     5                        having it happen only in the snx::sonix destructor. 
     6                        NEW VERSION: 1.3.6 
    37Sep-25-2007 patrick     Changed method signatures to remove passing of 
    48                        fundamental types by const reference. 
  • juggler/trunk/modules/sonix/VERSION

    r20865 r20871  
     11.3.6-0 @09/26/2007 19:50:00 UTC@ 
    121.3.5-0 @09/25/2007 21:35:00 UTC@ 
    231.3.4-0 @09/25/2007 21:30:00 UTC@ 
  • juggler/trunk/modules/sonix/snx/sonix.cpp

    r20865 r20871  
    5858sonix::~sonix() 
    5959{ 
    60    // release the implementation 
    61    if (mImplementation != NULL) 
    62    { 
    63       // unload all sound data 
    64       mImplementation->unbindAll(); 
    65  
    66       // shutdown old api if exists 
    67       mImplementation->shutdownAPI(); 
    68       delete mImplementation; 
    69       mImplementation = NULL; 
     60   if ( NULL != mImplementation ) 
     61   { 
     62      shutdownAPI(); 
    7063   } 
    7164} 
     
    230223} 
    231224 
     225// Destructor. 
     226void sonix::shutdownAPI() 
     227{ 
     228   // release the implementation 
     229   if ( mImplementation != NULL ) 
     230   { 
     231      // unload all sound data 
     232      mImplementation->unbindAll(); 
     233 
     234      // shutdown old api if exists 
     235      mImplementation->shutdownAPI(); 
     236      delete mImplementation; 
     237      mImplementation = NULL; 
     238   } 
     239} 
     240 
    232241void sonix::configure(const snx::SoundAPIInfo& sai) 
    233242{ 
  • juggler/trunk/modules/sonix/snx/sonix.h

    r20865 r20871  
    243243 
    244244   /** 
     245    * If there is a sound API currently active, its sounds are unbound, and 
     246    * it is told to shut itself down. 
     247    * 
     248    * @post \c mImplementation is NULL. 
     249    * 
     250    * @since 1.3.6 
     251    */ 
     252   void shutdownAPI(); 
     253 
     254   /** 
    245255    * Configures/reconfigures the sound API global settings. 
    246256    *