root/trunk/libffado/src/libcontrol/Nickname.cpp

Revision 1498, 1.7 kB (checked in by ppalmers, 15 years ago)

Merge all changes from 2.0 branch into trunk (since r1361). This _should_ contain all forward merges done in the mean time. At this moment in time both branches should be in sync.

Line 
1 /*
2  * Copyright (C) 2005-2008 by Pieter Palmers
3  *
4  * This file is part of FFADO
5  * FFADO = Free Firewire (pro-)audio drivers for linux
6  *
7  * FFADO is based upon FreeBoB
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 2 of the License, or
12  * (at your option) version 3 of the License.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21  *
22  */
23
24 #include "Nickname.h"
25 #include "ffadodevice.h"
26
27 namespace Control {
28
29 //// --- Nickname --- ////
30 Nickname::Nickname(FFADODevice &d)
31 : Text(&d)
32 , m_Device( d )
33 {
34     setName("Nickname");
35     setLabel("Nickname");
36     setDescription("Get/Set device nickname");
37 }
38
39 bool
40 Nickname::setValue(std::string v)
41 {
42     debugOutput( DEBUG_LEVEL_VERBOSE, "%s setValue(%s)\n",
43                  getName().c_str(), v.c_str());
44     return m_Device.setNickname(v);
45 }
46
47 std::string
48 Nickname::getValue()
49 {
50     debugOutput( DEBUG_LEVEL_VERBOSE, "%s getValue()=%s\n",
51                  getName().c_str(), m_Device.getNickname().c_str());
52     return m_Device.getNickname();
53 }
54
55 bool
56 Nickname::canChangeValue()
57 {
58     return m_Device.canChangeNickname();
59 }
60
61 void
62 Nickname::show()
63 {
64     debugOutput( DEBUG_LEVEL_NORMAL, "Nickname Element %s, %s\n",
65         getName().c_str(), m_Device.getNickname().c_str());
66 }
67
68 } // namespace Control
Note: See TracBrowser for help on using the browser.