| 154 | * @brief clock source types |
---|
| 155 | */ |
---|
| 156 | enum eClockSourceType { |
---|
| 157 | eCT_Invalid, ///> invalid entry (e.g. on error) |
---|
| 158 | eCT_Internal, ///> internal sync (unspecified) |
---|
| 159 | eCT_1394Bus, ///> Sync on the 1394 bus clock (e.g. CSP) |
---|
| 160 | eCT_SytMatch, ///> SYT match on incoming audio stream |
---|
| 161 | eCT_SytStream, ///> SYT match on incoming sync stream |
---|
| 162 | eCT_WordClock, ///> SYT on WordClock input |
---|
| 163 | eCT_SPDIF, ///> SYT on SPDIF input |
---|
| 164 | eCT_ADAT, ///> SYT on ADAT input |
---|
| 165 | eCT_TDIF, ///> SYT on TDIF input |
---|
| 166 | eCT_AES, ///> SYT on AES input |
---|
| 167 | }; |
---|
| 168 | |
---|
| 169 | /** |
---|
| 170 | * @brief convert the clock source type to a C string |
---|
| 171 | * @return a C string describing the clock source type |
---|
| 172 | */ |
---|
| 173 | static const char *ClockSourceTypeToString(enum eClockSourceType); |
---|
| 174 | |
---|
| 175 | /** |
---|
| 176 | * @brief Clock source identification struct |
---|
| 177 | */ |
---|
| 178 | struct sClockSource { |
---|
| 179 | sClockSource() |
---|
| 180 | : type( eCT_Invalid ) |
---|
| 181 | , id( 0 ) |
---|
| 182 | , valid( false ) |
---|
| 183 | , active( false ) |
---|
| 184 | , description( "" ) |
---|
| 185 | {} |
---|
| 186 | /// indicates the type of the clock source (e.g. eCT_ADAT) |
---|
| 187 | enum eClockSourceType type; |
---|
| 188 | /// indicated the id of the clock source (e.g. id=1 => clocksource is ADAT_1) |
---|
| 189 | unsigned int id; |
---|
| 190 | /// is the clock source valid at this moment? |
---|
| 191 | bool valid; |
---|
| 192 | /// is the clock source active at this moment? |
---|
| 193 | bool active; |
---|
| 194 | /// description of the clock struct (optional) |
---|
| 195 | std::string description; |
---|
| 196 | }; |
---|
| 197 | typedef struct sClockSource ClockSource; |
---|
| 198 | |
---|
| 199 | typedef std::vector< ClockSource > ClockSourceVector; |
---|
| 200 | typedef std::vector< ClockSource >::iterator ClockSourceVectorIterator; |
---|
| 201 | |
---|
| 202 | /** |
---|
| 203 | * @brief Get the clocksources supported by this device |
---|
| 204 | * |
---|
| 205 | * This function returns a vector of ClockSource structures that contains |
---|
| 206 | * one entry for every clock source supported by the device. |
---|
| 207 | * |
---|
| 208 | * @returns a vector of ClockSource structures |
---|
| 209 | */ |
---|
| 210 | virtual ClockSourceVector getSupportedClockSources() = 0; |
---|
| 211 | |
---|
| 212 | |
---|
| 213 | /** |
---|
| 214 | * @brief Sets the active clock source of this device |
---|
| 215 | * |
---|
| 216 | * This function sets the clock source of the device. |
---|
| 217 | * |
---|
| 218 | * @returns true upon success. false upon failure. |
---|
| 219 | */ |
---|
| 220 | virtual bool setActiveClockSource(ClockSource) = 0; |
---|
| 221 | |
---|
| 222 | /** |
---|
| 223 | * @brief Returns the active clock source of this device |
---|
| 224 | * |
---|
| 225 | * This function returns the active clock source of the device. |
---|
| 226 | * |
---|
| 227 | * @returns the active ClockSource |
---|
| 228 | */ |
---|
| 229 | virtual ClockSource getActiveClockSource() = 0; |
---|
| 230 | |
---|
| 231 | /** |
---|