Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
da42dfcd
Commit
da42dfcd
authored
Jan 17, 2021
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for wide strings (wchar_t) to the engine.
parent
3eb0f400
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
research/miniaudio_engine.h
research/miniaudio_engine.h
+20
-2
No files found.
research/miniaudio_engine.h
View file @
da42dfcd
...
...
@@ -1678,6 +1678,7 @@ MA_API ma_result ma_engine_play_sound(ma_engine* pEngine, const char* pFilePath,
#ifndef MA_NO_RESOURCE_MANAGER
MA_API
ma_result
ma_sound_init_from_file
(
ma_engine
*
pEngine
,
const
char
*
pFilePath
,
ma_uint32
flags
,
ma_async_notification
*
pNotification
,
ma_sound_group
*
pGroup
,
ma_sound
*
pSound
);
MA_API
ma_result
ma_sound_init_from_file_w
(
ma_engine
*
pEngine
,
const
wchar_t
*
pFilePath
,
ma_uint32
flags
,
ma_async_notification
*
pNotification
,
ma_sound_group
*
pGroup
,
ma_sound
*
pSound
);
#endif
MA_API
ma_result
ma_sound_init_from_data_source
(
ma_engine
*
pEngine
,
ma_data_source
*
pDataSource
,
ma_uint32
flags
,
ma_sound_group
*
pGroup
,
ma_sound
*
pSound
);
MA_API
void
ma_sound_uninit
(
ma_sound
*
pSound
);
...
...
@@ -9582,7 +9583,7 @@ static ma_result ma_sound_init_from_data_source_internal(ma_engine* pEngine, ma_
}
#ifndef MA_NO_RESOURCE_MANAGER
MA_API
ma_result
ma_sound_init_from_file
(
ma_engine
*
pEngine
,
const
char
*
pFilePath
,
ma_uint32
flags
,
ma_async_notification
*
pNotification
,
ma_sound_group
*
pGroup
,
ma_sound
*
pSound
)
MA_API
ma_result
ma_sound_init_from_file
_internal
(
ma_engine
*
pEngine
,
const
char
*
pFilePath
,
const
wchar_t
*
pFilePathW
,
ma_uint32
flags
,
ma_async_notification
*
pNotification
,
ma_sound_group
*
pGroup
,
ma_sound
*
pSound
)
{
ma_result
result
;
...
...
@@ -9601,7 +9602,14 @@ MA_API ma_result ma_sound_init_from_file(ma_engine* pEngine, const char* pFilePa
will get triggered before this function returns. This is OK, so long as the caller is aware of
it and can avoid accessing the sound from within the notification.
*/
result
=
ma_resource_manager_data_source_init
(
pEngine
->
pResourceManager
,
pFilePath
,
flags
|
MA_DATA_SOURCE_FLAG_WAIT_INIT
,
pNotification
,
&
pSound
->
resourceManagerDataSource
);
flags
|=
MA_DATA_SOURCE_FLAG_WAIT_INIT
;
if
(
pFilePath
!=
NULL
)
{
result
=
ma_resource_manager_data_source_init
(
pEngine
->
pResourceManager
,
pFilePath
,
flags
,
pNotification
,
&
pSound
->
resourceManagerDataSource
);
}
else
{
result
=
ma_resource_manager_data_source_init_w
(
pEngine
->
pResourceManager
,
pFilePathW
,
flags
,
pNotification
,
&
pSound
->
resourceManagerDataSource
);
}
if
(
result
!=
MA_SUCCESS
)
{
return
result
;
}
...
...
@@ -9617,6 +9625,16 @@ MA_API ma_result ma_sound_init_from_file(ma_engine* pEngine, const char* pFilePa
return
MA_SUCCESS
;
}
MA_API
ma_result
ma_sound_init_from_file
(
ma_engine
*
pEngine
,
const
char
*
pFilePath
,
ma_uint32
flags
,
ma_async_notification
*
pNotification
,
ma_sound_group
*
pGroup
,
ma_sound
*
pSound
)
{
return
ma_sound_init_from_file_internal
(
pEngine
,
pFilePath
,
NULL
,
flags
,
pNotification
,
pGroup
,
pSound
);
}
MA_API
ma_result
ma_sound_init_from_file_w
(
ma_engine
*
pEngine
,
const
wchar_t
*
pFilePath
,
ma_uint32
flags
,
ma_async_notification
*
pNotification
,
ma_sound_group
*
pGroup
,
ma_sound
*
pSound
)
{
return
ma_sound_init_from_file_internal
(
pEngine
,
NULL
,
pFilePath
,
flags
,
pNotification
,
pGroup
,
pSound
);
}
#endif
MA_API
ma_result
ma_sound_init_from_data_source
(
ma_engine
*
pEngine
,
ma_data_source
*
pDataSource
,
ma_uint32
flags
,
ma_sound_group
*
pGroup
,
ma_sound
*
pSound
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment