[Openal] OpenAL with C++ WindowsForm application?
Ümit Uzun
umituzun84 at gmail.com
Tue Sep 29 05:27:12 PDT 2009
Hi All;
Thanks for your all relies.
>Stefanos, I have looked at openTK but I have an specific situation. OpenAL
is wrap our soundCard or emulate soundCard by Generic Software and it
encapsulate all low level function, but by using Framework I can select
expected channel to play mono sound. For example I can play different mono
sound to different channel by using specified configuration in
Framework.cpp, if I use OpenTK could I inject some part of framework?
template<typename T> T *load_data(const T *data, int size, const char
*channels)
{
size /= sizeof(T);
T *data71 = new T[size * 8];
for(int i = 0; i < size; i++)
{
data71[i * 8 + 0] = channels[0] == '1' ? data[i] : 0; // front-left
speaker
data71[i * 8 + 1] = channels[1] == '1' ? data[i] : 0; //
front-right speaker
data71[i * 8 + 2] = channels[2] == '1' ? data[i] : 0; //
front-center speaker
data71[i * 8 + 3] = channels[3] == '1' ? data[i] : 0; // low
frequency (sub-woofer) speaker
data71[i * 8 + 4] = channels[4] == '1' ? data[i] : 0; // back-left
speaker
data71[i * 8 + 5] = channels[5] == '1' ? data[i] : 0; // back-right
speaker
data71[i * 8 + 6] = channels[6] == '1' ? data[i] : 0; // side-left
speaker
data71[i * 8 + 7] = channels[7] == '1' ? data[i] : 0; // side-right
speaker
}
return data71;
}
>Pierre, I can't understand your soulution. Where should I add "stdafx.h" in
my code? Did you add stdafx.h to Framework or your own code?
By the experiment on WindowsForm using QT framework will be much easy I
think. I don't decided which GUI should use but if there is much striction
on WindowsForm about OpenAL, qt would be good solution. I don't want to use
wrapper because I love coding on low level OpenAL and it's much controllable
to me. If I can't solve this problem without wrapper usage I would use
different GUI I think.
Thanks for your awesome answers.
Regards.
Ümit Uzun
2009/9/28 Reese <quattro004 at gmail.com>
> If your interested I've been working on an object oriented wrapper that is
> very close to being ready for its first release, it's written in c# and
> comes with unit tests and some samples. I'm currently finishing up streaming
> but most of the other features are there, if nothing else it might provide a
> good place to start. My goal is to recruit people to use it in a game soon
> and write some articles on how to use it. If you use it let me know what you
> think. http://openal-net-sdk.sourceforge.net
>
>
> On Mon, Sep 28, 2009 at 8:05 AM, Stefanos A. <stapostol at gmail.com> wrote:
>
>> On Mon, 2009-09-28 at 10:48 -0400, Jason Daly wrote:
>> > I'm not an authority on CLR or Forms, but I do know that if you want to
>> > use OpenAL with the CLR, you'll have to wrap the library so you can
>> > access the native OpenAL methods from your managed code.
>>
>> Generally, C++/CLI supports "it just works" (IJW) interop with plain C
>> libraries, but there might be few cases where you'll have to fix things
>> by hand. I'm not especially familiar with C++/CLI but this seems like
>> one of those cases.
>>
>> The CLR generally uses delegates to pass managed function pointers to
>> unmanaged code and vice versa. Try wrapping this function to receive a
>> delegate decorated decorated with the UnmangedFunctionPointerAttribute.
>>
>> The other approach is to use a full-blown managed wrapper around OpenAL
>> and avoid the need to wrap things by hand. There are a few of those out
>> there - I'd recommend OpenTK (http://www.opentk.com), if only because I
>> happen to be its main developer. :) This is a low-level, "flat" wrapper
>> around OpenAL (i.e. *not* an object oriented abstraction), but it takes
>> advantage of some features not available in plain C (e.g. strong types,
>> enumerations, function overloads,, generics).
>>
>> > Ümit Uzun wrote:
>> > > Hi All,
>> > >
>> > > I have an application which had created with MFC before and now I want
>> > > to upgrade it with new OpenAL 1.1 version and Windows Form. I have
>> > > created new C++ WindowsForm project in VS2008 and only add framework
>> > > and set related include and library configurations. But when I compile
>> > > I always get
>> > >
>> > > .\OpenAL\framework\Win32\Framework.cpp(200) : error C2664:
>> > > 'CWaves::GetWaveALBufferFormat' : cannot convert parameter 2 from
>> > > 'ALenum (__cdecl *)(const ALchar *)' to 'PFNALGETENUMVALUE'
>> > > Address of a function yields __clrcall calling convention in /clr:pure
>> > > and /clr:safe; consider using __clrcall in target type
>> > >
>> > > error which I can't find anything at internet about. I think it is
>> > > related about /clr because we have to use CommonLanguageRuntimeSupport
>> > > beside with MFC we don't need clr.
>> > >
>> > > How can I solve my problem?
>> > > Do you think I can create OpenAL based application which uses
>> > > framework like before with Windows Form or not?
>> > >
>> > > Regards.
>> > >
>> > > Ümit Uzun
>> >
>> > _______________________________________________
>> > Openal mailing list
>> > Openal at opensource.creative.com
>> > http://opensource.creative.com/mailman/listinfo/openal
>>
>> _______________________________________________
>> Openal mailing list
>> Openal at opensource.creative.com
>> http://opensource.creative.com/mailman/listinfo/openal
>>
>
>
> _______________________________________________
> Openal mailing list
> Openal at opensource.creative.com
> http://opensource.creative.com/mailman/listinfo/openal
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://opensource.creative.com/pipermail/openal/attachments/20090929/fdfc7f7f/attachment.html
More information about the Openal
mailing list