1 |
/* |
---|
2 |
* Copyright (C) 2009 by Pieter Palmers |
---|
3 |
* Copyright (C) 2012 by Philippe Carriere |
---|
4 |
* Copyright (C) 2012 by Jano Svitok |
---|
5 |
* |
---|
6 |
* This file is part of FFADO |
---|
7 |
* FFADO = Free Firewire (pro-)audio drivers for linux |
---|
8 |
* |
---|
9 |
* FFADO is based upon FreeBoB. |
---|
10 |
* |
---|
11 |
* This program is free software: you can redistribute it and/or modify |
---|
12 |
* it under the terms of the GNU General Public License as published by |
---|
13 |
* the Free Software Foundation, either version 2 of the License, or |
---|
14 |
* (at your option) version 3 of the License. |
---|
15 |
* |
---|
16 |
* This program is distributed in the hope that it will be useful, |
---|
17 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
19 |
* GNU General Public License for more details. |
---|
20 |
* |
---|
21 |
* You should have received a copy of the GNU General Public License |
---|
22 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
23 |
* |
---|
24 |
*/ |
---|
25 |
|
---|
26 |
#ifndef DICE_MAUDIO_PROFIRE_2626_H |
---|
27 |
#define DICE_MAUDIO_PROFIRE_2626_H |
---|
28 |
|
---|
29 |
#include "dice/dice_avdevice.h" |
---|
30 |
#include "dice/dice_eap.h" |
---|
31 |
|
---|
32 |
#include "libieee1394/configrom.h" |
---|
33 |
|
---|
34 |
// Global monitor registers (application space) |
---|
35 |
#define MAUDIO_PROFIRE2626_REGISTER_APP_VOLUME_KNOB_OFFSET 0x00 |
---|
36 |
#define MAUDIO_PROFIRE2626_REGISTER_APP_VOLUME_KNOB_SIZE 4 |
---|
37 |
#define MAUDIO_PROFIRE2626_REGISTER_APP_VOLUME_KNOB_VALUE 1 |
---|
38 |
#define MAUDIO_PROFIRE2626_REGISTER_APP_VOLUME_KNOB_SHIFT 0 |
---|
39 |
|
---|
40 |
namespace Dice { |
---|
41 |
namespace Maudio { |
---|
42 |
|
---|
43 |
class Profire2626 : public Dice::Device { |
---|
44 |
public: |
---|
45 |
Profire2626( DeviceManager& d, |
---|
46 |
ffado_smartptr<ConfigRom>( configRom )); |
---|
47 |
virtual ~Profire2626(); |
---|
48 |
|
---|
49 |
bool discover(); |
---|
50 |
|
---|
51 |
virtual void showDevice(); |
---|
52 |
|
---|
53 |
bool canChangeNickname() { return false; } |
---|
54 |
|
---|
55 |
class Profire2626EAP : public Dice::EAP |
---|
56 |
{ |
---|
57 |
public: |
---|
58 |
Profire2626EAP(Dice::Device& dev); |
---|
59 |
|
---|
60 |
void setupSources_low(); |
---|
61 |
void setupDestinations_low(); |
---|
62 |
void setupSources_mid(); |
---|
63 |
void setupDestinations_mid(); |
---|
64 |
void setupSources_high(); |
---|
65 |
void setupDestinations_high(); |
---|
66 |
void setupDefaultRouterConfig_low(); |
---|
67 |
void setupDefaultRouterConfig_mid(); |
---|
68 |
void setupDefaultRouterConfig_high(); |
---|
69 |
|
---|
70 |
bool readApplicationReg(unsigned, quadlet_t*); |
---|
71 |
bool writeApplicationReg(unsigned, quadlet_t); |
---|
72 |
|
---|
73 |
/** |
---|
74 |
* @brief A standard-switch for boolean. |
---|
75 |
* |
---|
76 |
* If you don't like True and False for the labels, subclass and return your own. |
---|
77 |
* \internal copy&paste from focusrite_eap.h |
---|
78 |
*/ |
---|
79 |
class Switch : public Control::Boolean |
---|
80 |
{ |
---|
81 |
public: |
---|
82 |
Switch(Profire2626EAP*, std::string, size_t, int); |
---|
83 |
bool selected(); |
---|
84 |
bool select(bool); |
---|
85 |
private: |
---|
86 |
Profire2626EAP* m_eap; |
---|
87 |
std::string m_name; |
---|
88 |
size_t m_offset; |
---|
89 |
int m_activevalue; |
---|
90 |
}; |
---|
91 |
|
---|
92 |
class SettingsSection : public Control::Container |
---|
93 |
{ |
---|
94 |
public: |
---|
95 |
SettingsSection(Profire2626EAP*, std::string); |
---|
96 |
private: |
---|
97 |
Profire2626EAP * m_eap; |
---|
98 |
}; |
---|
99 |
}; |
---|
100 |
|
---|
101 |
private: |
---|
102 |
Dice::EAP* createEAP(); |
---|
103 |
}; |
---|
104 |
|
---|
105 |
} |
---|
106 |
} |
---|
107 |
|
---|
108 |
#endif |
---|
109 |
// vim: et |
---|