[00:44:17] <wild> anyone here? [00:45:35] <KittyCat> yeah. [00:45:39] <KittyCat> what's it doing? [00:46:23] <wild> lol well i got it to play if only one file is loaded but how would i go about check if the file exsist and if it dosnt / there is no file present [00:46:29] <wild> skip all steps [00:46:56] <wild> in open i just put if(path.length() == 0){}else{dosteps} [00:47:11] <wild> but when i run the code i get the first few seconds of 1.ogg then it stops [00:49:27] <KittyCat> can probably add a IsValid() method that returns if the file is loaded and playing [00:49:54] <wild> http://pastebin.com/m3740e4b2 [00:52:47] <KittyCat> you don't need the Sources vector anymore [00:54:15] <KittyCat> should also return if fopen fails instead of continuing to try to load it [00:55:13] <KittyCat> and call release() on each cAudio object before it's destroyed/goes out of scope [00:58:08] <wild> so if fopen fails [00:58:34] <wild> return it fails then what [00:58:52] <wild> maybe i should take a break [01:00:10] <KittyCat> you'd have an isvalid function that would say if the object is working (eg. the file was opened and is ready to play) [01:00:41] <wild> and if it is valid then i throw it to the main vector? [01:00:47] <wild> i throw it to thevector? [01:00:54] <KittyCat> no. if it's valid, then you call update and stuff on it [01:01:02] <KittyCat> otherwise, it gets skipped [01:01:56] <KittyCat> can also check it after you call open() so you can tell if it was loaded or not [01:02:22] <wild> couldnt i use a bool? [01:02:30] <KittyCat> yeah [01:02:47] <KittyCat> isvalid() can check the oggMemoryFile.dataPtr field for a valid pointer. if it's NULL, it's not valid (returns false). if it's not NULL, it's valid (returns true) [01:02:49] <wild> if ( isvalid == true){ then do everything else [01:02:57] <KittyCat> just make sure to set that field to NULL in the constructor [01:03:23] <KittyCat> if((*i)->isvalid()) { do stuff.. } [01:04:06] <wild> ok i get ya [01:04:19] <KittyCat> if(!audio.isvalid()) printf("Could not load blah\n"); [01:09:02] <wild> worked like a charm :) [01:09:23] <wild> cpu usage 1 % [01:09:26] *** prophile has quit IRC [01:16:22] <wild> the difficulty [01:16:30] <wild> checking nvm :) [01:21:13] <wild> engine now has full ogg support [01:21:59] <KittyCat> :) [01:22:58] <wild> i found some tutorials to get mod,xm,sed,and it support [01:23:01] <wild> it shouldnt take long [01:41:43] *** kb1ooo has joined #openal [01:41:43] *** ChanServ sets mode: +v kb1ooo [02:03:01] <wild> woot! [02:06:34] <wild> http://pastebin.com/m1fc3b5b1 [02:06:35] <wild> it supports ogg,xm,mod,s3d,and it [02:07:41] <KittyCat> just as an FYI, you should probably use const std::string& for parameters instead of std::string [02:08:12] <wild> kk [02:08:37] <wild> as for today im done with openal ill clean up the code when the time comes i still need to make the user able to set the parameters of the listener and the sound object [02:12:43] <kb1ooo> using const std::string& is particularly a problem across dll boundaries. [02:12:59] <KittyCat> it is? [02:13:00] <kb1ooo> i mean, *not* using const std::string& [02:13:04] <KittyCat> oh [02:13:08] <KittyCat> yeah, it could be [02:13:22] <wild> guys0-0\ [02:13:47] <wild> std string& were? [02:13:50] <wild> in the parameters? [02:13:55] <KittyCat> yeah [02:14:10] <KittyCat> where you use std::string/string, use const std::string& instead [02:14:11] <kb1ooo> yes, because of runtime allocators. when you pass by value, it gets allocated on client side. but deleted on dll side. [02:14:58] <wild> the & broke it [02:15:07] <wild> o const [02:15:40] <KittyCat> how? [02:15:51] <wild> fixed [02:17:44] <wild> now its time for relaxing and playing loud music [03:26:45] *** wild has quit IRC [06:33:14] *** jvalenzu has quit IRC [07:07:00] *** barra_away has joined #openal [07:07:01] *** ChanServ sets mode: +v barra_away [07:23:40] *** barra_ has quit IRC [07:25:37] *** wild has joined #openal [07:25:37] *** ChanServ sets mode: +v wild [10:20:06] *** wild has quit IRC [11:41:41] *** juanmabc has joined #openal [11:41:41] *** ChanServ sets mode: +v juanmabc [12:01:53] *** barra_away is now known as barra_ [12:51:14] * KittyCat is away: sleep [12:52:33] *** prophile has joined #openal [12:52:34] *** ChanServ sets mode: +v prophile [15:03:11] *** prophile has quit IRC [15:04:42] *** prophile has joined #openal [15:04:43] *** ChanServ sets mode: +v prophile [16:59:17] *** jvalenzu has joined #openal [16:59:18] *** ChanServ sets mode: +v jvalenzu [17:00:39] *** qknight has quit IRC [17:04:41] *** qknight has joined #openal [17:04:42] *** ChanServ sets mode: +v qknight [17:08:22] *** tsaotsao has joined #openal [17:08:22] *** ChanServ sets mode: +v tsaotsao [17:17:10] *** jvalenzu has quit IRC [18:24:09] *** wild has joined #openal [18:24:09] *** ChanServ sets mode: +v wild [18:24:13] <wild> mornin [18:29:42] *** wild has quit IRC [18:34:56] *** wild has joined #openal [18:34:56] *** ChanServ sets mode: +v wild [19:41:54] *** Walt has joined #openal [19:41:54] *** ChanServ sets mode: +v Walt [19:51:04] <wild> afternoon [20:57:41] *** Walt has quit IRC [20:59:48] <KittyCat> hi [21:13:14] * KittyCat is back. [21:32:29] *** Walt has joined #openal [21:32:29] *** ChanServ sets mode: +v Walt [21:36:37] *** barra_away has joined #openal [21:36:37] *** ChanServ sets mode: +v barra_away [21:55:08] *** barra_ has quit IRC [22:05:23] <wild> hey everyone [22:05:38] <angasule> hi [22:08:51] <KittyCat> hi [22:10:03] <wild> whats up? [22:10:50] <KittyCat> not much [22:12:53] <wild> step 1 of the audio engine is complete now i need to figure out how to make a global listener [22:12:59] <wild> for all cAudios and be able to edit it [22:13:09] <wild> after i get that i can have full 3d support [22:14:34] <KittyCat> it doesn't have to be through the cAudio class (which should probably be renamed to cSound) [22:15:00] <wild> hmm [22:15:20] <wild> how would you go around pulling it off? [22:15:20] <KittyCat> you can call AL's listener functions as-is. doesn't have to be in a class [22:15:32] <KittyCat> only needs to be in a class if you need to store extra data with it [22:16:00] <wild> o ok so the alSource3f only stores the sounds info correct? its position [22:16:25] <KittyCat> right [22:16:44] <wild> makes my life even easier i make a functions to wrap around the listener function [22:16:47] <KittyCat> using a class there is fine because you have to store other data with it (OggVorbis_File, etc) [22:17:05] <wild> then just add parameters to the open(); function to change the audios position and such :) [22:18:45] <KittyCat> I don't think alListener functions need to be wrapped around [22:19:01] <KittyCat> it's a global state, with no explicit object [22:19:32] <wild> i mean wrapped so the user dosnt have to type alListener()< and set the postition [22:19:53] <wild> be something simple like audio.setListener(); << somehow that will be easier to use [22:20:15] <wild> im making this also for others to use so the easier it is the better [22:20:27] <KittyCat> a singleton inlined class would probably be best, then [22:21:03] <wild> i really just need teh listener global [22:21:15] <wild> they are only going to need one listener witch is the player they have [22:21:31] <KittyCat> class cListener { [22:21:59] <KittyCat> cListener &getInstance() { static cListener This; return This; } [22:22:05] <KittyCat> public: [22:22:31] <KittyCat> void setPosition(ALfloat *pos) { alListenerfv(AL_POSITION, pos); } [22:22:34] <KittyCat> ... [22:22:35] <KittyCat> } [22:22:40] <KittyCat> then to use: [22:22:56] <KittyCat> cListener &audio = cListener::getInstance(); [22:23:03] <KittyCat> audio.setPosition(...); [22:23:46] <KittyCat> with the functions declared in the class like that, they should be inlined for no processing cost, so it'd be just like they called the AL function directly [22:23:50] <wild> but isnt the singleton design do audio->sePosition [22:24:13] <KittyCat> doesn't have to be, but if you wanted: [22:24:20] <KittyCat> cListener *audio = &(cListener::getInstance()); [22:24:26] <KittyCat> audio->setPosition(...); [22:24:41] <wild> ahh ok now this allows them to change the position of the listener [22:24:48] <wild> during runtime to correct? [22:24:54] <KittyCat> yeah [22:25:03] <wild> openal is still extremly new to me so you explaining everything is wonderful :) [22:25:17] <KittyCat> (should actually make those functions static, btw) [22:25:55] <KittyCat> and make sure they're defined in the class itself, so the compiler will inline them [22:26:29] <wild> what is inline? [22:26:58] <KittyCat> it's so the compiler replaces the actual function call with the code inside the function [22:27:41] <KittyCat> for smaller functions, it saves on the call instruction and stack pushing/popping [22:27:48] <wild> ahh [22:28:12] <KittyCat> so for instance, calling audio.setPosition(p); will generate code as if the app called alListenerfv(AL_POSITION, p); directly [22:30:02] <wild> alright :) cool [22:30:35] <wild> problem is i still need a easy way to transfer 3 corrdinates to a alfloat [22:30:38] <wild> i dont want them to have to typ [22:30:53] <wild> ALfloat = ....; then throw it in unless [22:31:01] <wild> they can enter the cords directly into the setPosition [22:31:24] *** Walt has quit IRC [22:31:29] <KittyCat> setPosition(ALfloat x, ALfloat y, ALfloat z) you mean? [22:31:45] <wild> yeah [22:31:57] <wild> instead of having it accept a alfloat with 3 corrdinates [22:32:10] <wild> i want to allow them to just enter the 3 parameters [22:32:14] <KittyCat> static void setPosition(ALfloat x, ALfloat y, ALfloat z) { alListener3f(AL_POSITION, x, y, z); } [22:32:26] <wild> ahh didnt think it would be that easy... [22:35:15] <wild> so now the listener should be to far away from 0.0 now and i shouldnt hear the sound / should barley hear it [22:36:49] <wild> alright simple problem im getting [22:37:23] <wild> cAudio audio; [22:37:30] <wild> then cListener &audio = cinstance [22:37:34] <wild> will give me problems correct? [22:37:53] <wild> becuase audio is alreayd a cAudio object correct/ [22:40:17] <wild> when i do cListener &audio3 = cListener::getInstance(); [22:40:41] <wild> i get a cannont call member function cListener& cListener::get innstance() without object [22:44:51] <KittyCat> make the functions static [22:45:11] <wild> do i make the get instance static? [22:45:24] <KittyCat> yes, and the others too [22:47:33] <wild> still gives me same [22:47:46] <KittyCat> paste your code [22:52:34] <wild> http://pastebin.com/m598fc925 [22:58:06] *** Walt has joined #openal [22:58:06] *** ChanServ sets mode: +v Walt [22:58:48] <wild> any idea? [23:00:35] <wild> got it i think had to put it under public [23:03:34] <wild> wow that didnt work... [23:03:35] *** barra__out has joined #openal [23:03:35] *** ChanServ sets mode: +v barra__out [23:06:48] *** barra__out has quit IRC [23:11:20] <wild> i dont thinkt he listener is working i set the rooloff_factor from 0.1 to 5.0 [23:11:43] <wild> set the x position and z positiont o 1000 and up and i turned alsourcerelative to false [23:19:50] *** Walt_ has joined #openal [23:19:51] *** ChanServ sets mode: +v Walt_ [23:21:13] <wild> i think i gots it :) [23:21:57] *** barra_away has quit IRC [23:26:34] <wild> nope nvm [23:31:58] *** barra_away has joined #openal [23:31:58] *** ChanServ sets mode: +v barra_away [23:35:26] <wild> jesus [23:36:15] *** barra_away is now known as barra_ [23:36:54] *** Walt has quit IRC [23:47:19] <wild> now i got it