AlsaBridge.h
author František Kučera <franta-hg@frantovo.cz>
Mon, 04 Jan 2021 13:38:08 +0100
branchv_0
changeset 11 5b351628a377
parent 5 ef8f4023e32e
child 12 15d87fdd6e6c
permissions -rw-r--r--
Find card by a name pattern (regular expression) instead using hardcoded name.
By default, we look for card with name matching the "Pioneer DJ.*" pattern and we expect exactly one card to be found.
Custom pattern can be provided as a command-line argument.

Whole name would look something like this: "Pioneer DJ Corporation DJM-250MK2 at usb-0000:01:00.0-10.1, high speed".
franta-hg@2
     1
/**
franta-hg@2
     2
 * DJM-Fix
franta-hg@2
     3
 * Copyright © 2020 František Kučera (Frantovo.cz, GlobalCode.info)
franta-hg@2
     4
 *
franta-hg@2
     5
 * This program is free software: you can redistribute it and/or modify
franta-hg@2
     6
 * it under the terms of the GNU General Public License as published by
franta-hg@2
     7
 * the Free Software Foundation, version 3 of the License.
franta-hg@2
     8
 *
franta-hg@2
     9
 * This program is distributed in the hope that it will be useful,
franta-hg@2
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@2
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
franta-hg@2
    12
 * GNU General Public License for more details.
franta-hg@2
    13
 *
franta-hg@2
    14
 * You should have received a copy of the GNU General Public License
franta-hg@2
    15
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
franta-hg@2
    16
 */
franta-hg@2
    17
#pragma once
franta-hg@2
    18
franta-hg@5
    19
#include <string>
franta-hg@5
    20
franta-hg@2
    21
#include "DJMFix.h"
franta-hg@2
    22
franta-hg@2
    23
namespace djmfix {
franta-hg@2
    24
namespace alsa {
franta-hg@2
    25
franta-hg@2
    26
class AlsaBridge {
franta-hg@2
    27
public:
franta-hg@2
    28
	virtual ~AlsaBridge() = default;
franta-hg@2
    29
	virtual void start() = 0;
franta-hg@2
    30
	virtual void stop() = 0;
franta-hg@2
    31
franta-hg@2
    32
};
franta-hg@2
    33
franta-hg@11
    34
AlsaBridge* create(djmfix::DJMFix* djmFix, const std::string& cardNamePattern);
franta-hg@2
    35
franta-hg@2
    36
}
franta-hg@3
    37
}