song comment

portability/boost
zetaPRIME 2019-06-20 14:52:30 -04:00
parent 91d7d1d695
commit 5fc2c4b750
5 changed files with 34 additions and 22 deletions

14
notes
View File

@ -6,11 +6,7 @@ IMPORTANT LINKS {
}
project data {
samples are held in memory as {
QString name, QUuid id (used as dictionary key) (?)
sample rate, channel count (1 or 2), length
probably QSharedPointer to raw float array (size=length*channels, non-interleaved)
}
...
}
parameters {
@ -46,7 +42,7 @@ TODO {
- actual config file loading/saving
color scheme load/save
indexer abstraction for audioports (assign/add std::pair<float, float>)
- indexer abstraction for audioports (assign/add std::pair<float, float>)
maybe a similar abstraction for processing notes to what commandreader does
@ -57,15 +53,15 @@ TODO {
}
misc features needed before proper release {
song metadata (title, artist, comment, default bpm)
- song metadata (title, artist, comment, default bpm)
at *least* js plugin support, with lua+lv2 highly preferable
SAMPLES and SAMPLING
- SAMPLES and SAMPLING
- gadget widgets (w/container) - at least a knob with nice range and such
different context menu for multiple selected nodes
pack/unpack selection to/from subgraph
/ pack/unpack selection to/from subgraph (partial; can copy/paste a selection)
proper playback controls and indicators
play from current pattern

View File

@ -27,6 +27,7 @@ namespace Xybrid::Data {
QString title;
QString artist;
QString comment;
QString fileName;

View File

@ -73,7 +73,7 @@ bool FileOps::saveProject(std::shared_ptr<Project> project, QString fileName) {
meta[qs("artist")] = project->artist;
meta[qs("title")] = project->title;
meta[qs("comment")] = project->comment;
meta[qs("tempo")] = project->tempo;
main[qs("meta")] = meta;
@ -184,6 +184,7 @@ std::shared_ptr<Project> FileOps::loadProject(QString fileName) {
QCborMap meta = main.value("meta").toMap();
project->artist = meta.value("artist").toString();
project->title = meta.value("title").toString();
project->comment = meta.value("comment").toString();
project->tempo = meta.value("tempo").toDouble(project->tempo);
}

View File

@ -155,6 +155,8 @@ MainWindow::MainWindow(QWidget *parent) :
connect(ui->editArtist, &QLineEdit::textEdited, this, [this](const QString& s) { project->artist = s; updateTitle(); });
connect(ui->editTitle, &QLineEdit::textEdited, this, [this](const QString& s) { project->title = s; updateTitle(); });
connect(ui->editComment, &QPlainTextEdit::modificationChanged, this, [this](bool b) { if (b) { project->comment = ui->editComment->document()->toPlainText(); ui->editComment->document()->setModified(false); } });
connect(ui->editTempo, qOverload<double>(&QDoubleSpinBox::valueChanged), this, [this](double t) { project->tempo = t; });
}
@ -448,6 +450,7 @@ void MainWindow::onNewProjectLoaded() {
ui->editArtist->setText(project->artist);
ui->editTitle->setText(project->title);
ui->editComment->document()->setPlainText(project->comment);
updateTitle();
setSongInfoPaneExpanded(false);
@ -508,6 +511,7 @@ void MainWindow::setSongInfoPaneExpanded(bool open) {
ui->songInfoPane->setCurrentIndex(1);
} else {
ui->songInfoPane->setCurrentIndex(0);
ui->patternEditor->setFocus(Qt::FocusReason::ShortcutFocusReason);
}
auto s = ui->songInfoPane->currentWidget()->minimumHeight();
ui->songInfoPane->setMinimumHeight(s);

View File

@ -214,7 +214,7 @@
<property name="minimumSize">
<size>
<width>0</width>
<height>56</height>
<height>240</height>
</size>
</property>
<property name="maximumSize">
@ -360,6 +360,26 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="labelComment">
<property name="text">
<string>Comment</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="minimumSize">
<size>
<width>5</width>
<height>0</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelTempo">
<property name="text">
@ -409,17 +429,7 @@
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
<widget class="QPlainTextEdit" name="editComment"/>
</item>
</layout>
</widget>