@@ -548,6 +548,23 @@ LUA_FUNCTION_STATIC(IGModAudioChannel_GetChannelData)
548548 return 2 ;
549549}
550550
551+ LUA_FUNCTION_STATIC (IGModAudioChannel_GetChannelCount)
552+ {
553+ IGModAudioChannel* channel = Get_IGModAudioChannel (LUA, 1 , true );
554+
555+ const char * pError = nullptr ;
556+ int nChannelCount = channel->GetChannelCount (&pError);
557+ if (pError)
558+ {
559+ LUA->PushNil ();
560+ LUA->PushString (pError);
561+ } else {
562+ LUA->PushNumber (nChannelCount);
563+ LUA->PushNil ();
564+ }
565+ return 2 ;
566+ }
567+
551568LUA_FUNCTION_STATIC (IGModAudioChannel_SetFX)
552569{
553570 IGModAudioChannel* channel = Get_IGModAudioChannel (LUA, 1 , true );
@@ -895,6 +912,23 @@ LUA_FUNCTION_STATIC(IGModAudioChannel_SetMixerMatrix)
895912 return 2 ;
896913}
897914
915+ LUA_FUNCTION_STATIC (IGModAudioChannel_GetMixerChannelCount)
916+ {
917+ IGModAudioChannel* channel = Get_IGModAudioChannel (LUA, 1 , true );
918+
919+ const char * pError = nullptr ;
920+ int nChannelCount = channel->GetMixerChannelCount (&pError);
921+ if (pError)
922+ {
923+ LUA->PushNil ();
924+ LUA->PushString (pError);
925+ } else {
926+ LUA->PushNumber (nChannelCount);
927+ LUA->PushNil ();
928+ }
929+ return 2 ;
930+ }
931+
898932LUA_FUNCTION_STATIC (IGModAudioChannel_IsSplitter)
899933{
900934 IGModAudioChannel* channel = Get_IGModAudioChannel (LUA, 1 , true );
@@ -1479,6 +1513,7 @@ void CBassModule::LuaInit(GarrysMod::Lua::ILuaInterface* pLua, bool bServerInit)
14791513 Util::AddFunc (pLua, IGModAudioChannel_GetAttribute, " GetAttribute" );
14801514 Util::AddFunc (pLua, IGModAudioChannel_IsAttributeSliding, " IsAttributeSliding" );
14811515 Util::AddFunc (pLua, IGModAudioChannel_GetChannelData, " GetChannelData" );
1516+ Util::AddFunc (pLua, IGModAudioChannel_GetChannelCount, " GetChannelCount" );
14821517
14831518 Util::AddFunc (pLua, IGModAudioChannel_SetFX, " SetFX" );
14841519 Util::AddFunc (pLua, IGModAudioChannel_ResetFX, " ResetFX" );
@@ -1495,6 +1530,7 @@ void CBassModule::LuaInit(GarrysMod::Lua::ILuaInterface* pLua, bool bServerInit)
14951530 Util::AddFunc (pLua, IGModAudioChannel_RemoveMixerChannel, " RemoveMixerChannel" );
14961531 Util::AddFunc (pLua, IGModAudioChannel_GetMixerState, " GetMixerState" );
14971532 Util::AddFunc (pLua, IGModAudioChannel_SetMixerMatrix, " SetMixerMatrix" );
1533+ Util::AddFunc (pLua, IGModAudioChannel_GetMixerChannelCount, " GetMixerChannelCount" );
14981534
14991535 Util::AddFunc (pLua, IGModAudioChannel_IsSplitter, " IsSplitter" );
15001536 Util::AddFunc (pLua, IGModAudioChannel_ResetSplitStream, " ResetSplitStream" );
0 commit comments