-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XML config files for Live Broadcasting preferences #1283
Conversation
I initially forgot to add broadcastprofile.cpp into the list of source files in build/depends.py, so I didn't noticed all the errors and mistakes I've made while writing this earlier. This commit aims to fix these errors and have the BroadcastProfile class to build.
No idea if this works. I just want to make sure it is saved somewhere out of my computer. I may squash this with other commits later.
Both ways didn't handled the document's root tag. Now, profile values are saved properly.
src/broadcast/broadcastmanager.cpp
Outdated
@@ -6,14 +6,15 @@ | |||
#include "engine/sidechain/enginesidechain.h" | |||
#include "soundio/soundmanager.h" | |||
|
|||
BroadcastManager::BroadcastManager(UserSettingsPointer pConfig, | |||
BroadcastManager::BroadcastManager(SettingsManagerPointer pSettingsManager, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since you do not store the pointer, you should pass it as plain pointer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@daschuer Same when passing it to DlgPreferences?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Shard pointer for shared ownership. With a plain pointer parameter, the function promises not to store the pointer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@daschuer Okay. If thinking this way, I think I should use shared pointers for BroadcastProfile
instances.
{ | ||
EncoderBroadcastSettings::EncoderBroadcastSettings( | ||
BroadcastSettingsPointer settings) : | ||
m_settings(settings) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style nit:
EncoderBroadcastSettings::EncoderBroadcastSettings(
BroadcastSettingsPointer settings)
: m_settings(settings) {
This isn't needed in the current state of the code.
These additions automatically fetches existing Live Broadcasting preferences from mixxx.cfg, puts them in the Default Profile and removes the now useless keys from mixxx.cfg
Nice, please give a hint when this is worth to test manually. |
Add more tests in the process, because the regex changed.
probably you need to take a look at upgrade.cpp/.h. |
src/preferences/broadcastprofile.cpp
Outdated
return nullptr; | ||
|
||
QString profileName = xmlFile.baseName(); | ||
BroadcastProfile* profile = new BroadcastProfile(profileName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here you should use std::make_unique<> and return the BroadcastProfilePtr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
I refactored BroadcastSettings::m_profiles as a std::map<QString,
BroadcastProfilePtr>. The map key and the profile name are synchronized
with a signal/slot pair triggered when a call to
BroadcastProfile::setProfileName is made.
What do you think of this solution?
Perfect!
|
I forgot to connect |
…t call BroadcastProfile notifies name changes to BroadcastSettings with Qt's signals & slots system. However Qt is not compatible with the std::unique_ptr smart pointer. A refactor of BroadcastProfilePtr is required to make it compatible. std::unique_ptr has been replaced with QSharedPointer, as this type is easy to pass around in the code while keeping a reference to the original pointer and deleting it when not used anymore.
Loading resources from "/home/daniel/workspace/advanced_autodj_2/res/" Else it works nice. Thank you. |
@daschuer Did you tried with the latest changes? This assert call was removed in one of them. |
I have rebuid and tested it again, and it still fails. Is it a linux only issue? |
My bad, I was supposed to remove |
This looks goo to me so far, is there anything left to do in this branch? |
@daschuer Not much left to do: making sure it is ready for handling several broadcasting outputs/profiles. |
I believe there's nothing left to do on this. As usual, I'm open for comments on these contributions! |
Fine, am happy with this as well so you can merge it to your GSoC branch and advance to the next PR. |
Should this PR be closed? |
Yes, absolutely. Work continues in #1300. |
These contributions add an XML settings system for Live Broadcasting settings which allows management of several named sets of settings (a.k.a "profiles").
This is phase 1 out of 2 of my GSoC project for Mixxx to add multi-broadcasting to Mixxx (being able to stream to several servers simultaneously). Each broadcasting output will have its own profile
This PR aims to implement this subsystem into Mixxx while keep the current Live Broadcasting preferences UI, which will be refactored in phase 2. Settings are saved in an XML document named
Default Profile.bcp.xml
located in thebroadcast_profiles
subfolder of Mixxx's settings folder.Tasks: