*** AUDIO ENGINE ***

Post Reply
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

*** AUDIO ENGINE ***

Post by ezee »

As new comer , i try to understand the actual Game Engine , and naturally his components .
In this thread , i will relate the things that i notice while i go deeper in the code
FOR THE AUDIO ENGINE, and also the changes that i will make ( with a reason why )
There is also a task in the roadmap for the audio part in 0.5.2 :
[OPEN] (klauss) sound refactoring Phase II would add mixer channels (a feature to get seamless blending with music, comm chatter and sfx)
So ... perhaps i will find time or occasion to work in it .

I notice that the naming conventions are not so well designed , and don't help for the overall understanding .
Minor thing , but minor+minor+minor+minor = horror :lol:

So in my local dev , i started to rename some non-critical functions :
in main.cpp :

Code: Select all

/// could be renamed initAudioSceneManager()
// so do it
// old name is initSceneManager()
void initAudioSceneManager()
{ ...}

Code: Select all

/// could be renamed initAudioScenes()
// so do it
// old name is initScenes()
void initAudioScenes()
That seem really minor , but when you look to the place where they are called :

Code: Select all

AUDInit();
    AUDListenerGain( game_options.sound_gain );
    Music::InitMuzak();
    
    initSceneManager();// ---> you understand what ?
    initALRenderer();
    initScenes();// ---> you understand what ?
A little bit confusing ...

So my new calls look like that :

Code: Select all

AUDInit();
    AUDListenerGain( game_options.sound_gain );
    Music::InitMuzak();
    
    initAudioSceneManager();
    initALRenderer();
    initAudioScenes();
That is more logical and help the reader to stay tuned .
I will continue this thread with new changes later .
' hope you will like it !
:)

edit : other case , similar of bad naming

Code: Select all

///another case of bad naming ...
///update to closeAudioRenderer()
///old is closeRenderer()
void closeAudioRenderer()
{
    cerr << "Shutting down audio renderer..." << endl; // i added audio ...
    Audio::SceneManager::getSingleton()->setRenderer( SharedPtr<Audio::Renderer>() );
}
the call was in the end of main(...)

Code: Select all

...
   _Universe->Loop( bootstrap_first_loop );

    //Unregister commands - and cleanup memory
    UninitShipCommands();
    
    closeRenderer(); // ----> which renderer ?

    cleanup();

    delete _Universe;
    CleanupUnitTables();
    return 0;
}
now the call is

Code: Select all

...
  _Universe->Loop( bootstrap_first_loop );

   //Unregister commands - and cleanup memory
   UninitShipCommands();
   closeAudioRenderer(); //--> everybody know now ...

    cleanup();

    delete _Universe;
    CleanupUnitTables();
    return 0;
}

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: *** AUDIO ENGINE ***

Post by klauss »

ezee wrote:As new comer , i try to understand the actual Game Engine , and naturally his components .
In this thread , i will relate the things that i notice while i go deeper in the code
FOR THE AUDIO ENGINE, and also the changes that i will make ( with a reason why )
There is also a task in the roadmap for the audio part in 0.5.2 :
[OPEN] (klauss) sound refactoring Phase II would add mixer channels (a feature to get seamless blending with music, comm chatter and sfx)
So ... perhaps i will find time or occasion to work in it .
Uuhh... what we need to make progress here, is check thread-safety (I was kinda cautious in the design to make it possible, but there are some road blocks in the way) and make a thread that keeps streaming sources flowing. Ideally, one thread would handle all streaming sources at once. It's... tricky. But more than doable.

With that, we could move on rather quickly.

Just in case you're looking for tasks ;)
ezee wrote:I notice that the naming conventions are not so well designed , and don't help for the overall understanding .
Minor thing , but minor+minor+minor+minor = horror :lol:

So in my local dev , i started to rename some non-critical functions :
in main.cpp :
Um... ouch. Um.. not a good idea.

I mean, the renaming itself is a good idea, keeping it in your local copy isn't. The further it drifts from upstream the harder it will be for all of us in the future. Small stuff like that is best pushed upstream as fast as possible, in small, easy to review and summarily commitable patches (in the patch tracker).
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: *** AUDIO ENGINE ***

Post by ezee »

I mean, the renaming itself is a good idea, keeping it in your local copy isn't. The further it drifts from upstream the harder it will be for all of us in the future. Small stuff like that is best pushed upstream as fast as possible, in small, easy to review and summarily commitable patches (in the patch tracker).
Ok .
But my environment is not enough stable , i had std::vector errors yesterday with a fresh
install of 0.5.2 . I don't feel confident ...

I definitivly need to find the good solution with svn ( for vc9 ) before doing anything .

Off topic:
( i have started a project with gfxlib , all the needed files in a separate vc9 solution , compiled ok .

Code: Select all

1>------ Build started: Project: GFXLIB, Configuration: Release Win32 ------
1>Compiling...
1>gfxlib.cpp
1>ani_texture.cpp
1>viewarea.cpp
1>track.cpp
1>sphere_display.cpp
1>sensor.cpp
1>radar.cpp
1>plane_display.cpp
1>dual_display.cpp
1>bubble_display.cpp
1>navscreen.cpp
1>navpath.cpp
1>navcomputer.cpp
1>drawsystem.cpp
1>drawlist.cpp
1>drawgalaxy.cpp
1>criteria.cpp
1>warptrail.cpp
1>vsimage.cpp
1>vsbox.cpp
1>Compiling...
1>vdu.cpp
1>technique.cpp
1>stream_texture.cpp
1>star.cpp
1>sprite.cpp
1>sphere_generic.cpp
1>sphere.cpp
1>ring.cpp
1>quadtree_xml.cpp
1>quadtree.cpp
1>quadsquare_update.cpp
1>quadsquare_render.cpp
1>quadsquare_cull.cpp
1>quadsquare.cpp
1>pipelined_texture.cpp
1>particle.cpp
1>mesh_xml.cpp
1>mesh_poly.cpp
1>mesh_gfx.cpp
1>mesh_fx.cpp
1>Compiling...
1>mesh_bxm.cpp
1>mesh_bin.cpp
1>mesh.cpp
1>loc_select.cpp
1>hud.cpp
1>halo_system.cpp
1>halo.cpp
1>gauge.cpp
1>env_map_gent.cpp
1>coord_select.cpp
1>cockpit_xml.cpp
1>cockpit_generic.cpp
1>cockpit.cpp
1>camera.cpp
1>background.cpp
1>aux_texture.cpp
1>aux_logo.cpp
1>animation.cpp
1>Creating library...
1>Build log was saved at "file://d:\program\trunk\vega-vc9\GFXLIB\Release\BuildLog.htm"
1>GFXLIB - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
It seem to me that this was intended to be a dll .
I will try to make a class ( done without implementation now ), and see where that goes ( with cockpit for example ... )
It's a straight maneer to see how the video is managed , and the many interdependencies.[/offtopic]

I will PM you later ( when i will be stable ) to help me for the patches etc ...
thx

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
Post Reply