diff options
author | Jonas Suhr Christensen <jsc@umbraculum.org> | 2014-03-19 21:12:24 +0100 |
---|---|---|
committer | Jonas Suhr Christensen <jsc@umbraculum.org> | 2014-03-19 21:12:24 +0100 |
commit | c852a24fc978ca7916c0f5819bfed870a1d9519e (patch) | |
tree | a3ac7ee0fc886e0f1d361a7c4734d0b65824d7ff /dgedit | |
parent | aa656f19d015febb1174c0c91cb1711657280c70 (diff) | |
parent | 63bf74ffaeb5580af677719485c40fe50e248f51 (diff) |
Merge branch 'master' of http://git.drumgizmo.org/drumgizmo
Diffstat (limited to 'dgedit')
-rw-r--r-- | dgedit/Makefile.am | 30 | ||||
-rw-r--r-- | dgedit/audioextractor.cc | 1 | ||||
-rw-r--r-- | dgedit/samplesorter.cc | 4 | ||||
-rw-r--r-- | dgedit/selection.h | 2 |
4 files changed, 22 insertions, 15 deletions
diff --git a/dgedit/Makefile.am b/dgedit/Makefile.am index 09bfe22..2925f74 100644 --- a/dgedit/Makefile.am +++ b/dgedit/Makefile.am @@ -5,8 +5,8 @@ if HAVE_EDITOR bin_PROGRAMS = dgedit -dgedit_LDADD = $(SNDFILE_LIBS) $(QT_LIBS) $(shell ../tools/MocList o ) \ - $(AO_LIBS) +dgedit_LDADD = $(SNDFILE_LIBS) $(QT_LIBS) $(AO_LIBS) \ + $(shell ../tools/MocList o ) qrc_dgedit.o dgedit_CXXFLAGS = $(SNDFILE_CXXFLAGS) $(QT_CFLAGS) $(AO_CFLAGS) AM_CXXFLAGS = $(QT_CFLAGS) @@ -23,8 +23,7 @@ dgedit_SOURCES = \ itemeditor.cc \ mainwindow.cc \ mipmap.cc \ - samplesorter.cc \ - dgedit.qrc + samplesorter.cc EXTRA_DIST = \ audioextractor.h \ @@ -38,25 +37,28 @@ EXTRA_DIST = \ mainwindow.h \ mipmap.h \ samplesorter.h \ - selection.h + selection.h \ + dgedit.qrc dgedit_MOC = $(shell ../tools/MocList cc ) -dgedit_qrc.cpp: dgedit.qrc - rcc $< > $@ - -BUILT_SOURCES = $(dgedit_MOC) dgedit_qrc.cpp +BUILT_SOURCES = $(dgedit_MOC) qrc_dgedit.cc CLEANFILES = $(BUILT_SOURCES) +qrc_%.cc: %.qrc + rcc $< > $@ + %.moc.cc: %.h $(QT_MOC) -o $@ $< -%.h: %.ui - $(QT_UIC) -o $@ $< - -%.cc: %.ui - $(QT_UIC) -o $@ -impl $*.h $< +# +# ui files not used in this project... +#%.h: %.ui +# $(QT_UIC) -o $@ $< +# +#%.cc: %.ui +# $(QT_UIC) -o $@ -impl $*.h $< # command for creating .res file from .rc on Win32 %.res: %.rc diff --git a/dgedit/audioextractor.cc b/dgedit/audioextractor.cc index 2a0dcf5..9692b0b 100644 --- a/dgedit/audioextractor.cc +++ b/dgedit/audioextractor.cc @@ -161,6 +161,7 @@ void AudioExtractor::exportSelections(Selections selections, QDomElement sample = doc.createElement("sample"); sample.setAttribute("name", i->name); + sample.setAttribute("power", QString::number(i->energy)); samples.appendChild(sample); AudioFileList::iterator j = audiofiles.begin(); diff --git a/dgedit/samplesorter.cc b/dgedit/samplesorter.cc index adfdf65..8f857a6 100644 --- a/dgedit/samplesorter.cc +++ b/dgedit/samplesorter.cc @@ -139,7 +139,7 @@ void SampleSorter::resort() QMap<int, Selection>::iterator i = _selections.begin(); while(i != _selections.end()) { float energy = 0.0; - Selection s = i.value(); + Selection &s = i.value(); for(size_t idx = s.from; (idx < (size_t)s.from + (size_t)attackLength()) && @@ -152,6 +152,8 @@ void SampleSorter::resort() energy += 1; // Make sure that the key is unique. } + s.energy = energy; + sorted[energy] = i.value(); if(energy < min) min = energy; diff --git a/dgedit/selection.h b/dgedit/selection.h index 283b642..64e6d98 100644 --- a/dgedit/selection.h +++ b/dgedit/selection.h @@ -42,6 +42,8 @@ public: int fadein; int fadeout; + double energy; + QString name; }; |