2 * AtmoConnection.cpp: generic/abstract class defining all methods for the
3 * communication with the hardware
5 * See the README.txt file for copyright information and how to reach the author(s).
10 #include "AtmoConnection.h"
13 CAtmoConnection::CAtmoConnection(CAtmoConfig *cfg)
15 this->m_pAtmoConfig = cfg;
16 m_ChannelAssignment = NULL;
17 m_NumAssignedChannels = 0;
19 #if defined(_ATMO_VLC_PLUGIN_)
20 vlc_mutex_init( &m_AccessConnection );
22 InitializeCriticalSection( &m_AccessConnection );
26 CAtmoConnection::~CAtmoConnection(void)
31 #if defined(_ATMO_VLC_PLUGIN_)
32 vlc_mutex_destroy( &m_AccessConnection );
34 DeleteCriticalSection( &m_AccessConnection );
38 void CAtmoConnection::SetChannelAssignment(CAtmoChannelAssignment *ca)
43 delete m_ChannelAssignment;
44 m_ChannelAssignment = ca->getMapArrayClone(m_NumAssignedChannels);
49 #if !defined(_ATMO_VLC_PLUGIN_)
50 ATMO_BOOL CAtmoConnection::ShowConfigDialog(HINSTANCE hInst, HWND parent, CAtmoConfig *cfg)
52 MessageBox(parent, "This device doesn't have a special config dialog", "Info", 0);
58 void CAtmoConnection::Lock()
60 #if defined(_ATMO_VLC_PLUGIN_)
61 vlc_mutex_lock( &m_AccessConnection );
63 EnterCriticalSection( &m_AccessConnection );
66 void CAtmoConnection::Unlock()
68 #if defined(_ATMO_VLC_PLUGIN_)
69 vlc_mutex_unlock( &m_AccessConnection );
71 LeaveCriticalSection( &m_AccessConnection );