Changeset View
Changeset View
Standalone View
Standalone View
src/qml/plugin.cpp
Show All 25 Lines | |||||
26 | #include "client.h" | 26 | #include "client.h" | ||
27 | #include "sink.h" | 27 | #include "sink.h" | ||
28 | #include "source.h" | 28 | #include "source.h" | ||
29 | #include "context.h" | 29 | #include "context.h" | ||
30 | #include "modulemanager.h" | 30 | #include "modulemanager.h" | ||
31 | 31 | | |||
32 | #include "globalactioncollection.h" | 32 | #include "globalactioncollection.h" | ||
33 | #include "volumeosd.h" | 33 | #include "volumeosd.h" | ||
34 | #include "volumefeedback.h" | ||||
34 | 35 | | |||
35 | static QJSValue pulseaudio_singleton(QQmlEngine *engine, QJSEngine *scriptEngine) | 36 | static QJSValue pulseaudio_singleton(QQmlEngine *engine, QJSEngine *scriptEngine) | ||
36 | { | 37 | { | ||
37 | Q_UNUSED(engine) | 38 | Q_UNUSED(engine) | ||
38 | 39 | | |||
39 | QJSValue object = scriptEngine->newObject(); | 40 | QJSValue object = scriptEngine->newObject(); | ||
40 | object.setProperty(QStringLiteral("NormalVolume"), (double) QPulseAudio::Context::NormalVolume); | 41 | object.setProperty(QStringLiteral("NormalVolume"), (double) QPulseAudio::Context::NormalVolume); | ||
41 | object.setProperty(QStringLiteral("MinimalVolume"), (double) QPulseAudio::Context::MinimalVolume); | 42 | object.setProperty(QStringLiteral("MinimalVolume"), (double) QPulseAudio::Context::MinimalVolume); | ||
42 | object.setProperty(QStringLiteral("MaximalVolume"), (double) QPulseAudio::Context::MaximalVolume); | 43 | object.setProperty(QStringLiteral("MaximalVolume"), (double) QPulseAudio::Context::MaximalVolume); | ||
43 | return object; | 44 | return object; | ||
44 | } | 45 | } | ||
45 | 46 | | |||
46 | void Plugin::registerTypes(const char* uri) | 47 | void Plugin::registerTypes(const char* uri) | ||
47 | { | 48 | { | ||
48 | qmlRegisterType<QPulseAudio::CardModel>(uri, 0, 1, "CardModel"); | 49 | qmlRegisterType<QPulseAudio::CardModel>(uri, 0, 1, "CardModel"); | ||
49 | qmlRegisterType<QPulseAudio::SinkModel>(uri, 0, 1, "SinkModel"); | 50 | qmlRegisterType<QPulseAudio::SinkModel>(uri, 0, 1, "SinkModel"); | ||
50 | qmlRegisterType<QPulseAudio::SinkInputModel>(uri, 0, 1, "SinkInputModel"); | 51 | qmlRegisterType<QPulseAudio::SinkInputModel>(uri, 0, 1, "SinkInputModel"); | ||
51 | qmlRegisterType<QPulseAudio::SourceModel>(uri, 0, 1, "SourceModel"); | 52 | qmlRegisterType<QPulseAudio::SourceModel>(uri, 0, 1, "SourceModel"); | ||
52 | qmlRegisterType<QPulseAudio::ModuleManager>(uri, 0, 1, "ModuleManager"); | 53 | qmlRegisterType<QPulseAudio::ModuleManager>(uri, 0, 1, "ModuleManager"); | ||
53 | qmlRegisterType<QPulseAudio::SourceOutputModel>(uri, 0, 1, "SourceOutputModel"); | 54 | qmlRegisterType<QPulseAudio::SourceOutputModel>(uri, 0, 1, "SourceOutputModel"); | ||
54 | qmlRegisterType<QPulseAudio::StreamRestoreModel>(uri, 0, 1, "StreamRestoreModel"); | 55 | qmlRegisterType<QPulseAudio::StreamRestoreModel>(uri, 0, 1, "StreamRestoreModel"); | ||
55 | qmlRegisterType<GlobalAction>(uri, 0, 1, "GlobalAction"); | 56 | qmlRegisterType<GlobalAction>(uri, 0, 1, "GlobalAction"); | ||
56 | qmlRegisterType<GlobalActionCollection>(uri, 0, 1, "GlobalActionCollection"); | 57 | qmlRegisterType<GlobalActionCollection>(uri, 0, 1, "GlobalActionCollection"); | ||
57 | qmlRegisterType<VolumeOSD>(uri, 0, 1, "VolumeOSD"); | 58 | qmlRegisterType<VolumeOSD>(uri, 0, 1, "VolumeOSD"); | ||
59 | qmlRegisterType<VolumeFeedback>(uri, 0, 1, "VolumeFeedback"); | ||||
58 | qmlRegisterSingletonType(uri, 0, 1, "PulseAudio", pulseaudio_singleton); | 60 | qmlRegisterSingletonType(uri, 0, 1, "PulseAudio", pulseaudio_singleton); | ||
59 | 61 | | |||
60 | qmlRegisterType<QPulseAudio::Client>(); | 62 | qmlRegisterType<QPulseAudio::Client>(); | ||
61 | qmlRegisterType<QPulseAudio::Sink>(); | 63 | qmlRegisterType<QPulseAudio::Sink>(); | ||
62 | qmlRegisterType<QPulseAudio::Source>(); | 64 | qmlRegisterType<QPulseAudio::Source>(); | ||
63 | } | 65 | } |