mirror of https://github.com/status-im/nimqml.git
feat: sound manager added
This commit is contained in:
parent
d3fdb6eed2
commit
8d199aa829
|
@ -35,6 +35,7 @@ include "nimqml/private/singleinstance.nim"
|
|||
include "nimqml/private/status/statusevent.nim"
|
||||
include "nimqml/private/status/statusosnotification.nim"
|
||||
include "nimqml/private/status/statuskeychainmanager.nim"
|
||||
include "nimqml/private/status/statussoundmanager.nim"
|
||||
|
||||
proc signal_handler*(receiver: pointer, signal: cstring, slot: cstring) =
|
||||
var dosqobj = cast[DosQObject](receiver)
|
||||
|
|
|
@ -378,6 +378,11 @@ proc dos_keychainmanager_delete_data_async(vptr: DosStatusKeychainManager,
|
|||
proc dos_keychainmanager_delete(vptr: DosStatusKeychainManager)
|
||||
{.cdecl, dynlib: dynLibName, importc.}
|
||||
|
||||
# DosStatusSoundManager
|
||||
proc dos_soundmanager_play_sound(soundUrl: cstring) {.cdecl, dynlib: dynLibName, importc.}
|
||||
proc dos_soundmanager_set_player_volume(volume: int) {.cdecl, dynlib: dynLibName, importc.}
|
||||
proc dos_soundmanager_stop_player() {.cdecl, dynlib: dynLibName, importc.}
|
||||
|
||||
proc dos_to_local_file(fileUrl: cstring): cstring
|
||||
{.cdecl, dynlib: dynLibName, importc.}
|
||||
|
||||
|
|
|
@ -141,6 +141,8 @@ type
|
|||
StatusOSNotification* = ref object of QObject
|
||||
|
||||
StatusKeychainManager* = ref object of QObject
|
||||
|
||||
StatusSoundManager* = ref object of RootObj
|
||||
|
||||
const
|
||||
UserRole* = 0x100
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
proc setup(self: StatusSoundManager) =
|
||||
discard
|
||||
|
||||
proc delete*(self: StatusSoundManager) =
|
||||
discard
|
||||
|
||||
proc newStatusSoundManager*(): StatusSoundManager =
|
||||
new(result, delete)
|
||||
result.setup()
|
||||
|
||||
proc playSound*(self: StatusSoundManager, soundUrl: string) =
|
||||
dos_soundmanager_play_sound(soundUrl)
|
||||
|
||||
proc setPlayerVolume*(self: StatusSoundManager, volume: int) =
|
||||
dos_soundmanager_set_player_volume(volume)
|
||||
|
||||
proc stopPlayer*(self: StatusSoundManager) =
|
||||
dos_soundmanager_stop_player()
|
Loading…
Reference in New Issue