]> git.sesse.net Git - vlc/blob - modules/video_filter/atmo/AtmoConnection.cpp
Merge branch '1.0-bugfix'
[vlc] / modules / video_filter / atmo / AtmoConnection.cpp
1 /*
2  * AtmoConnection.cpp: generic/abstract class defining all methods for the
3  * communication with the hardware
4  *
5  * See the README.txt file for copyright information and how to reach the author(s).
6  *
7  * $Id$
8  */
9 #include "AtmoConnection.h"
10
11 CAtmoConnection::CAtmoConnection(CAtmoConfig *cfg)
12 {
13         this->m_pAtmoConfig = cfg;      
14     if(cfg->getNumChannelAssignments()>0) {
15         tChannelAssignment *ca = cfg->getChannelAssignment(0);
16         for(int i=0;i<ATMO_NUM_CHANNELS;i++) {
17             m_ChannelAssignment[i] = ca->mappings[i];
18         }
19     } else {
20         for(int i=0;i<ATMO_NUM_CHANNELS;i++) {
21             m_ChannelAssignment[i] = i;
22         }
23     }
24 }
25
26 void CAtmoConnection::SetChannelAssignment(tChannelAssignment *ca) {
27      for(int i=0;i<ATMO_NUM_CHANNELS;i++) {
28          m_ChannelAssignment[i] = ca->mappings[i];
29      }
30 }
31
32 CAtmoConnection::~CAtmoConnection(void)
33 {
34   if(isOpen())
35      CloseConnection();
36 }