AtmoDynData.cpp
上传用户:kjfoods
上传日期:2020-07-06
资源大小:29949k
文件大小:2k
源码类别:

midi

开发平台:

Unix_Linux

  1. /*
  2.  * AtmoDynData.cpp: class for holding all variable data - which may be
  3.  * passed between function calls, into threads instead of the use
  4.  * of global variables
  5.  *
  6.  * See the README.txt file for copyright information and how to reach the author(s).
  7.  *
  8.  * $Id: 701e80757d85ab975ed216802e59dddbeecf15bb $
  9.  */
  10. #include "AtmoDynData.h"
  11. #if defined(_ATMO_VLC_PLUGIN_)
  12. CAtmoDynData::CAtmoDynData(vlc_object_t *p_atmo_filter, CAtmoConfig *pAtmoConfig) {
  13.     this->p_atmo_filter     = p_atmo_filter;
  14.     this->m_pAtmoConfig     = pAtmoConfig;
  15.     this->m_pAtmoConnection = NULL;
  16.     this->m_pCurrentEffectThread = NULL;
  17.     vlc_mutex_init( &m_lock );
  18. }
  19. #else
  20. CAtmoDynData::CAtmoDynData(HINSTANCE hInst, CAtmoConfig *pAtmoConfig, CAtmoDisplays *pAtmoDisplays) {
  21.     this->m_pAtmoConfig     = pAtmoConfig;
  22.     this->m_pAtmoDisplays   = pAtmoDisplays;
  23.     this->m_pAtmoConnection = NULL;
  24.     this->m_pCurrentEffectThread = NULL;
  25.     this->m_hInst = hInst;
  26.     InitializeCriticalSection(&m_RemoteCallCriticalSection);
  27. }
  28. #endif
  29. CAtmoDynData::~CAtmoDynData(void)
  30. {
  31. #if defined(_ATMO_VLC_PLUGIN_)
  32.     vlc_mutex_destroy( &m_lock );
  33. #else
  34.     DeleteCriticalSection(&m_RemoteCallCriticalSection);
  35. #endif
  36. }
  37. void CAtmoDynData::LockCriticalSection() {
  38. #if defined(_ATMO_VLC_PLUGIN_)
  39.     vlc_mutex_lock( &m_lock );
  40. #else
  41.     EnterCriticalSection(&m_RemoteCallCriticalSection);
  42. #endif
  43. }
  44. void CAtmoDynData::UnLockCriticalSection() {
  45. #if defined(_ATMO_VLC_PLUGIN_)
  46.     vlc_mutex_unlock( &m_lock );
  47. #else
  48.     LeaveCriticalSection(&m_RemoteCallCriticalSection);
  49. #endif
  50. }