Skip to content

Instantly share code, notes, and snippets.

@mtomwing
Last active December 22, 2015 06:48
Show Gist options
  • Select an option

  • Save mtomwing/6433132 to your computer and use it in GitHub Desktop.

Select an option

Save mtomwing/6433132 to your computer and use it in GitHub Desktop.
from freeseer.framework.config.core import Config, ProfileManager
from freeseer.framework.config.persist import (
ConfigParserManager,
JSONConfigManager,
)
import freeseer.framework.config.options as options
class FreeseerConfig(Config):
videodir = options.FolderOption('/home/mtomwing/Videos', auto_create=True)
auto_hide = options.BooleanOption(True)
resolution = options.ChoiceOption([
'default',
'240p',
'360p',
'480p',
'720p',
'1080p',
], 'default')
enable_audio_recording = options.BooleanOption(True)
enable_video_recording = options.BooleanOption(True)
videomixer = options.StringOption('Video Passthrough')
audiomixer = options.StringOption('Audio Passthrough')
record_to_file = options.BooleanOption(True)
record_to_file_plugin = options.StringOption('Ogg Output')
record_to_stream = options.BooleanOption(False)
record_to_stream_plugin = options.StringOption('RTMP Streaming')
audio_feedback = options.BooleanOption(False)
video_preview = options.BooleanOption(True)
default_language = options.StringOption('tr_en_US.qm')
if __name__ == '__main__':
profile = ProfileManager('/tmp/freeseer/profiles', 'mtomwing')
managers = [
[ConfigParserManager, '.conf'],
[JSONConfigManager, '.json'],
]
for Manager, ext in managers:
storage = Manager(profile, 'freeseer' + ext)
config = storage.load(FreeseerConfig, 'Global')
storage.store(config, 'Global')
config.auto_hide = False
storage.store(config, 'Something Else')
@mtomwing
Copy link
Author

mtomwing commented Sep 4, 2013

$ cat freeseer.conf

[Global]
record_to_file_plugin = Ogg Output
audio_feedback = false
enable_audio_recording = true
videomixer = Video Passthrough
audiomixer = Audio Passthrough
default_language = tr_en_US.qm
record_to_stream_plugin = RTMP Streaming
auto_hide = true
enable_video_recording = true
record_to_stream = false
record_to_file = true
resolution = default
video_preview = true
videodir = /home/mtomwing/Videos

[Something Else]
record_to_file_plugin = Ogg Output
audio_feedback = false
enable_audio_recording = true
videomixer = Video Passthrough
audiomixer = Audio Passthrough
default_language = tr_en_US.qm
record_to_stream_plugin = RTMP Streaming
auto_hide = false
enable_video_recording = true
record_to_stream = false
record_to_file = true
resolution = default
video_preview = true
videodir = /home/mtomwing/Videos

$ cat freeseer.json

{
    "Global": {
        "audio_feedback": "false",
        "audiomixer": "Audio Passthrough",
        "auto_hide": "true",
        "default_language": "tr_en_US.qm",
        "enable_audio_recording": "true",
        "enable_video_recording": "true",
        "record_to_file": "true",
        "record_to_file_plugin": "Ogg Output",
        "record_to_stream": "false",
        "record_to_stream_plugin": "RTMP Streaming",
        "resolution": "default",
        "video_preview": "true",
        "videodir": "/home/mtomwing/Videos",
        "videomixer": "Video Passthrough"
    },
    "Something Else": {
        "audio_feedback": "false",
        "audiomixer": "Audio Passthrough",
        "auto_hide": "false",
        "default_language": "tr_en_US.qm",
        "enable_audio_recording": "true",
        "enable_video_recording": "true",
        "record_to_file": "true",
        "record_to_file_plugin": "Ogg Output",
        "record_to_stream": "false",
        "record_to_stream_plugin": "RTMP Streaming",
        "resolution": "default",
        "video_preview": "true",
        "videodir": "/home/mtomwing/Videos",
        "videomixer": "Video Passthrough"
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment