mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 04:35:34 +08:00
Use abstraction to refactor remote desk gui
This commit is contained in:
21
src/config_center/config_center.cpp
Normal file
21
src/config_center/config_center.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "config_center.h"
|
||||
|
||||
ConfigCenter::ConfigCenter() {}
|
||||
|
||||
ConfigCenter::~ConfigCenter() {}
|
||||
|
||||
int ConfigCenter::SetVideoQuality(VIDEO_QUALITY video_quality) {
|
||||
video_quality_ = video_quality;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ConfigCenter::SetLanguage(LANGUAGE language) {
|
||||
language_ = language;
|
||||
return 0;
|
||||
}
|
||||
|
||||
ConfigCenter::VIDEO_QUALITY ConfigCenter::GetVideoQuality() {
|
||||
return video_quality_;
|
||||
}
|
||||
|
||||
ConfigCenter::LANGUAGE ConfigCenter::GetLanguage() { return language_; }
|
||||
32
src/config_center/config_center.h
Normal file
32
src/config_center/config_center.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* @Author: DI JUNKUN
|
||||
* @Date: 2024-05-29
|
||||
* Copyright (c) 2024 by DI JUNKUN, All Rights Reserved.
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_CENTER_H_
|
||||
#define _CONFIG_CENTER_H_
|
||||
|
||||
class ConfigCenter {
|
||||
public:
|
||||
enum class VIDEO_QUALITY { LOW = 0, MEDIUM = 1, HIGH = 2 };
|
||||
enum class LANGUAGE { CHINESE = 0, ENGLISH = 1 };
|
||||
|
||||
public:
|
||||
ConfigCenter();
|
||||
~ConfigCenter();
|
||||
|
||||
public:
|
||||
int SetVideoQuality(VIDEO_QUALITY video_quality);
|
||||
int SetLanguage(LANGUAGE language);
|
||||
|
||||
public:
|
||||
VIDEO_QUALITY GetVideoQuality();
|
||||
LANGUAGE GetLanguage();
|
||||
|
||||
private:
|
||||
VIDEO_QUALITY video_quality_ = VIDEO_QUALITY::MEDIUM;
|
||||
LANGUAGE language_ = LANGUAGE::ENGLISH;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user