Ejemplo n.º 1
0
 private void _Dispose(bool disposing)
 {
     if (_Disposed)
     {
         return;
     }
     if (!disposing)
     {
         CLog.LogDebug("Did not close CPortAudioHandle");
     }
     //Make sure we do not leek any streams as we may keep PA open
     if (_Streams.Count > 0)
     {
         CLog.LogDebug("Did not close " + _Streams.Count + "PortAudio-Stream(s)");
         while (_Streams.Count > 0)
         {
             CloseStream(_Streams[0]);
         }
     }
     lock (_Mutex)
     {
         Debug.Assert(_RefCount > 0);
         _RefCount--;
         if (_RefCount == 0)
         {
             PortAudio.Pa_Terminate();
         }
     }
     _Disposed = true;
 }
Ejemplo n.º 2
0
 public override CTextureRef GetTexture(string name)
 {
     if (_Parent.Name == "Default" && !_Required.Textures.Contains(name))
     {
         CLog.LogDebug("Non-Default color: " + name);
     }
     return(base.GetTexture(name) ?? _BaseSkin.GetTexture(name));
 }
Ejemplo n.º 3
0
 public override CVideoStream GetVideo(string name, bool loop)
 {
     if (_Parent.Name == "Default" && !_Required.Videos.Contains(name))
     {
         CLog.LogDebug("Non-Default color: " + name);
     }
     return(base.GetVideo(name, loop) ?? _BaseSkin.GetVideo(name, loop));
 }
Ejemplo n.º 4
0
 public override bool GetColor(string name, out SColorF color)
 {
     if (_Parent.Name == "Default" && !_Required.Colors.Contains(name))
     {
         CLog.LogDebug("Non-Default color: " + name);
     }
     return(base.GetColor(name, out color) || _BaseSkin.GetColor(name, out color));
 }
 public override void OnSceneLoaded()
 {
     base.OnSceneLoaded();
     this.m_ResourceManager.LoadResource(() => {
         CLog.LogDebug("Download complete !!");
         this.OnTaskCompleted();
     }, (error) => {
         CLog.LogError(error);
         this.m_IsCompleteTask = false;
     }, (processing) => {
         this.m_UILoading.Processing(processing);
     });
 }
Ejemplo n.º 6
0
 public override bool Load()
 {
     _BaseSkin = CThemes.CurrentThemes[-1].CurrentSkin;
     if (!base.Load())
     {
         return(false);
     }
     for (int i = 1; i <= CSettings.MaxNumPlayer; i++)
     {
         if (!_Data.Colors.ContainsKey("Player" + i))
         {
             continue;
         }
         CLog.LogDebug("Party themes cannot contain player colors. They will be ignored!");
         break;
     }
     return(true);
 }
Ejemplo n.º 7
0
 private void _Dispose(bool disposing)
 {
     if (_Disposed)
     {
         return;
     }
     if (!disposing)
     {
         CLog.LogDebug("Did not close CPortAudioHandle");
     }
     //Make sure we do not leek any streams as we may keep PA open
     if (_Streams.Count > 0)
     {
         CLog.LogDebug("Did not close " + _Streams.Count + "PortAudio-Stream(s)");
         while (_Streams.Count > 0)
         {
             CloseStream(_Streams[0]);
         }
     }
     lock (_Mutex)
     {
         if (_Disposed)
         {
             return;
         }
         Debug.Assert(_RefCount > 0);
         _RefCount--;
         if (_RefCount == 0)
         {
             try
             {
                 PortAudio.Pa_Terminate();
             }
             catch (Exception ex)
             {
                 CLog.LogError(errorText: $"Error disposing PortAudio: {ex.Message}", e: ex);
             }
         }
         _Disposed = true;
     }
 }