CAVAPA-GUI  30.5.2014
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
sourcesettings.h
1 /****************************************************************************
2  * Copyright (c) 2014, Joel Kivelä, Erkki Koskenkorva, Oskari Leppäaho,
3  * Mika Lehtinen and Petri Partanen.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  * * Neither the name of the copyright holders nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
22  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 ****************************************************************************/
30 #ifndef SOURCESETTINGS_H
31 #define SOURCESETTINGS_H
32 
33 #include <map>
34 #include <string>
35 
36 #include "common.h"
37 #include "settings.h"
38 
39 namespace cavapa_gui
40 {
46 class SourceSettings : public Settings
47 {
48 private:
49  std::string sourceName;
50 
51 protected:
57  {
58  return sourceName != "";
59  }
60 
65  std::string getGroupName()
66  {
67  return sourceName;
68  }
69 
70 public:
76 
81  explicit SourceSettings(const std::string& sourceName);
82 
87  std::string getSourceName() const;
88 
93  void setCameraSettings(const cavapa::CameraSettings& cameraSettings);
94 
98  void setSourceName(const std::string& name);
99 
104  cavapa::CameraSettings toCameraSettings() const;
105 };
106 } //namespace cavapa_gui
107 
108 #endif // SOURCESETTINGS_H
bool canLoadOrSave()
Gets whether the SourceSettings instance can be saved or not.
Definition: sourcesettings.h:56
void setSourceName(const std::string &name)
Sets the name of the associated source.
Definition: sourcesettings.cpp:80
std::string getSourceName() const
Gets the name of the associated source.
Definition: sourcesettings.cpp:55
cavapa::CameraSettings toCameraSettings() const
Converts the instance of SourceSettings to CameraSettings.
Definition: sourcesettings.cpp:85
Represents the settings for a video source.
Definition: sourcesettings.h:46
SourceSettings()
Constructs a new SourceSettings object with default values and an empty name.
Definition: sourcesettings.cpp:39
Provides methods for loading and saving the application settings.
Definition: settings.h:48
void setCameraSettings(const cavapa::CameraSettings &cameraSettings)
Sets the camera settings for the instance of SourceSettings.
Definition: sourcesettings.cpp:60
std::string getGroupName()
Gets the name of the setting group.
Definition: sourcesettings.h:65