sv1-commits Mailing List for Sonic Visualiser (Page 5)
Brought to you by:
cannam
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(25) |
Oct
(57) |
Nov
(25) |
Dec
(11) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(36) |
Feb
(34) |
Mar
(55) |
Apr
(41) |
May
(25) |
Jun
(27) |
Jul
(22) |
Aug
(16) |
Sep
(33) |
Oct
(52) |
Nov
(79) |
Dec
(28) |
2008 |
Jan
(27) |
Feb
(56) |
Mar
(38) |
Apr
(32) |
May
(22) |
Jun
(55) |
Jul
(48) |
Aug
(10) |
Sep
(23) |
Oct
(32) |
Nov
(56) |
Dec
(71) |
2009 |
Jan
(35) |
Feb
(61) |
Mar
(52) |
Apr
(3) |
May
(18) |
Jun
(24) |
Jul
(13) |
Aug
(20) |
Sep
(27) |
Oct
(29) |
Nov
|
Dec
(1) |
2010 |
Jan
(3) |
Feb
(5) |
Mar
(8) |
Apr
(1) |
May
(20) |
Jun
(15) |
Jul
(8) |
Aug
(4) |
Sep
(3) |
Oct
|
Nov
(1) |
Dec
|
2011 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
(9) |
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
(3) |
Nov
(2) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ca...@us...> - 2009-10-20 15:11:12
|
Revision: 1663 http://sv1.svn.sourceforge.net/sv1/?rev=1663&view=rev Author: cannam Date: 2009-10-20 15:11:03 +0000 (Tue, 20 Oct 2009) Log Message: ----------- * Add version, date, confidence; link to svl files Modified Paths: -------------- annotation-converter/converter.cpp annotation-converter/index-all.sh Modified: annotation-converter/converter.cpp =================================================================== --- annotation-converter/converter.cpp 2009-10-19 14:51:15 UTC (rev 1662) +++ annotation-converter/converter.cpp 2009-10-20 15:11:03 UTC (rev 1663) @@ -20,7 +20,7 @@ void usage(char *name) { - cerr << "Usage: " << name << " file.lab [file2.lab ...] [-o file.ttl]" << endl; + cerr << "Usage: " << name << " [-v version] [-d date] file.lab [file2.lab ...] [-o file.ttl]" << endl; cerr << "Default output filename is annotations.ttl" << endl; exit(2); } @@ -308,9 +308,11 @@ store.addPrefix("event", "http://purl.org/NET/c4dm/event.owl#"); store.addPrefix("rdfs", "http://www.w3.org/2000/01/rdf-schema#"); store.addPrefix("tl", "http://purl.org/NET/c4dm/timeline.owl#"); - store.addPrefix("vamp", "http://purl.org/ontology/vamp/"); QString outfile = "annotations.ttl"; + QString version; + QString date; + QString confidence; for (int i = 1; i < argc; ++i) { if (!strcmp(argv[i], "-o") && i < argc-1) { @@ -319,10 +321,42 @@ cerr << "will write to file: " << outfile.toStdString() << endl; continue; } + if (!strcmp(argv[i], "-v") && i < argc-1) { + ++i; + version = argv[i]; + cerr << "will note version: " << version.toStdString() << endl; + continue; + } + if (!strcmp(argv[i], "-d") && i < argc-1) { + ++i; + date = argv[i]; + cerr << "will note date: " << date.toStdString() << endl; + continue; + } + if (!strcmp(argv[i], "-c") && i < argc-1) { + ++i; + confidence = argv[i]; + cerr << "will note confidence: " << confidence.toStdString() << endl; + continue; + } cerr << "reading file: " << argv[i] << endl; readFile(store, argv[i]); } + store.add(Triple("#", "a", store.expand("foaf:Document"))); + + if (version != "") { + store.addPrefix("ov", "http://open.vocab.org/terms/"); + store.add(Triple("#", "ov:versionnumber", Node(Node::Literal, version))); + } + if (date != "") { + store.add(Triple("#", "dc:created", Node(Node::Literal, date))); + } + if (confidence != "") { + store.addPrefix("ov", "http://open.vocab.org/terms/"); + store.add(Triple("#", "ov:confidence", Node(Node::Literal, confidence))); + } + cerr << "done, saving..." << endl; store.save(outfile); Modified: annotation-converter/index-all.sh =================================================================== --- annotation-converter/index-all.sh 2009-10-19 14:51:15 UTC (rev 1662) +++ annotation-converter/index-all.sh 2009-10-20 15:11:03 UTC (rev 1663) @@ -1,16 +1,24 @@ #!/bin/sh +# Run from within Annotations_(whatever)/all + label() { case "$1" in - seg) echo "Structural segmentation:";; - key) echo "Key changes:";; - chord) echo "Chords:";; - beat) echo "Beats:";; + seg) echo -n "Structural segmentation";; + key) echo -n "Key changes";; + chord) echo -n "Chords";; + beat) echo -n "Beats";; esac } +echo "<h2>Available annotations</h2><ul>" > ../index.html for x in *; do + ( cd .. ; tar czf "$x Annotations.tar.gz" */"$x" ) + ( + echo "<li><a href=\"$x.html\">$x</a><br>" >> ../index.html echo "<h2>$x</h2>" + echo "<a href=\"$x Annotations.tar.gz\">All $x annotations in a single tar.gz file</a>" + firsttrack="yes" for y in "$x"/*; do if [ -d "$y" ]; then album=`grep dc:title "$y"/*.ttl | sed 's/^.*dc:title //' | \ @@ -23,34 +31,48 @@ base="$y/`basename \"$z\" .ttl`" echo "<ul>" all="" + first="yes" for q in seg key chord beat; do - if [ -f "../$q/$base.txt" ]; then + if [ -f "../$q/$base.txt" ] || [ -f "../${q}lab/$base.lab" ]; then + if [ -n "$firsttrack" ]; then + if [ -z "$first" ]; then + echo "; " >> ../index.html + fi + first="" + label $q >> ../index.html + fi echo "<li>" label $q - echo "<a href=\"$q/$base.txt\">csv</a>" - echo "<a href=\"$q/$base.ttl\">rdf</a>" + echo ":" + if [ -f "../$q/$base.txt" ]; then + echo "<a href=\"$q/$base.txt\">csv</a>" + echo "<a href=\"$q/$base.ttl\">rdf</a>" + else + echo "<a href=\"${q}lab/$base.lab\">csv</a>" + echo "<a href=\"${q}lab/$base.ttl\">rdf</a>" + fi + if [ -f "../$q/$base.svl" ]; then + echo "<a href=\"$q/$base.svl\">svl</a>" + elif [ -f "../${q}lab/$base.svl" ]; then + echo "<a href=\"${q}lab/$base.svl\">svl</a>" + fi case $q in seg) ;; *) all=true;; esac - elif [ -f "../${q}lab/$base.lab" ]; then - echo "<li>" - label $q - echo "<a href=\"${q}lab/$base.lab\">csv</a>" - echo "<a href=\"${q}lab/$base.ttl\">rdf</a>" - case $q in - seg) ;; - *) all=true;; - esac fi done if [ -n "$all" ]; then echo "<li>All of the above: <a href=\"all/$base.ttl\">rdf</a>" fi echo "</ul>" + firsttrack="" done echo "</ol>" fi done + echo "</li>" >> ../index.html + ) > ../"$x".html done +echo "</ul>" >> ../index.html This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-10-19 14:51:26
|
Revision: 1662 http://sv1.svn.sourceforge.net/sv1/?rev=1662&view=rev Author: cannam Date: 2009-10-19 14:51:15 +0000 (Mon, 19 Oct 2009) Log Message: ----------- ... Modified Paths: -------------- annotation-converter/index-all.sh Modified: annotation-converter/index-all.sh =================================================================== --- annotation-converter/index-all.sh 2009-10-19 12:23:44 UTC (rev 1661) +++ annotation-converter/index-all.sh 2009-10-19 14:51:15 UTC (rev 1662) @@ -1,13 +1,56 @@ #!/bin/sh +label() { + case "$1" in + seg) echo "Structural segmentation:";; + key) echo "Key changes:";; + chord) echo "Chords:";; + beat) echo "Beats:";; + esac +} + for x in *; do - echo; echo "$x" - for y in "$x"/*; do - if [ -d "$y" ]; then - grep dc:title "$y"/*.ttl | sed 's/^.*dc:title //' | \ - sort | uniq -c | sort -n | tail -1 | \ - sed -e 's/^[ 0-9]*\"//' -e 's/" ; *$//' + echo "<h2>$x</h2>" + for y in "$x"/*; do + if [ -d "$y" ]; then + album=`grep dc:title "$y"/*.ttl | sed 's/^.*dc:title //' | \ + sort | uniq -c | sort -n | tail -1 | \ + sed -e 's/^[ 0-9]*\"//' -e 's/" ; *$//'` + echo "<h3>$album</h3><ol>" + for z in "$y/"*.ttl; do + track=`roqet -r json -e "PREFIX mo: <http://purl.org/ontology/mo/> PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?name FROM <file:$z> WHERE { ?a mo:track ?track . ?track dc:title ?name }" 2>/dev/null | fgrep '"value"' | sed -e 's/^.*": "//' -e 's/"[^"]*$//'` + echo "<li>$track" + base="$y/`basename \"$z\" .ttl`" + echo "<ul>" + all="" + for q in seg key chord beat; do + if [ -f "../$q/$base.txt" ]; then + echo "<li>" + label $q + echo "<a href=\"$q/$base.txt\">csv</a>" + echo "<a href=\"$q/$base.ttl\">rdf</a>" + case $q in + seg) ;; + *) all=true;; + esac + elif [ -f "../${q}lab/$base.lab" ]; then + echo "<li>" + label $q + echo "<a href=\"${q}lab/$base.lab\">csv</a>" + echo "<a href=\"${q}lab/$base.ttl\">rdf</a>" + case $q in + seg) ;; + *) all=true;; + esac + fi + done + if [ -n "$all" ]; then + echo "<li>All of the above: <a href=\"all/$base.ttl\">rdf</a>" fi - done + echo "</ul>" + done + echo "</ol>" + fi + done done This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-10-19 12:23:57
|
Revision: 1661 http://sv1.svn.sourceforge.net/sv1/?rev=1661&view=rev Author: cannam Date: 2009-10-19 12:23:44 +0000 (Mon, 19 Oct 2009) Log Message: ----------- ... Modified Paths: -------------- annotation-converter/convert-all.sh Added Paths: ----------- annotation-converter/index-all.sh Modified: annotation-converter/convert-all.sh =================================================================== --- annotation-converter/convert-all.sh 2009-10-16 16:28:51 UTC (rev 1660) +++ annotation-converter/convert-all.sh 2009-10-19 12:23:44 UTC (rev 1661) @@ -18,14 +18,14 @@ done find Annotations* \( -name \*.lab -o -name \*.txt \) -print > /tmp/$$ -cat /tmp/$$ | grep -v allannotations | \ - sed -e 's/^[^\/]*\/[^\/]*\///' -e 's/\.[^.]*//' | \ +cat /tmp/$$ | grep -v /all/ | grep -v allannotations | \ + sed -e 's/^[^\/]*\/[^\/]*\///' -e 's/\.[^.]*$//' | \ sort | uniq | \ while read stem; do echo "stem is $stem" mkdir -p "all/`dirname \"$stem\"`" rm -f "all/$stem.total" - grep "$stem" /tmp/$$ | while read x; do + fgrep "$stem" /tmp/$$ | while read x; do if [ -f "$x" ]; then cat "$x" >> "all/$stem.total" fi @@ -34,3 +34,4 @@ rm -f "all/$stem.total" done +rm /tmp/$$ Added: annotation-converter/index-all.sh =================================================================== --- annotation-converter/index-all.sh (rev 0) +++ annotation-converter/index-all.sh 2009-10-19 12:23:44 UTC (rev 1661) @@ -0,0 +1,13 @@ +#!/bin/sh + +for x in *; do + echo; echo "$x" + for y in "$x"/*; do + if [ -d "$y" ]; then + grep dc:title "$y"/*.ttl | sed 's/^.*dc:title //' | \ + sort | uniq -c | sort -n | tail -1 | \ + sed -e 's/^[ 0-9]*\"//' -e 's/" ; *$//' + fi + done +done + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-10-16 16:28:57
|
Revision: 1660 http://sv1.svn.sourceforge.net/sv1/?rev=1660&view=rev Author: cannam Date: 2009-10-16 16:28:51 +0000 (Fri, 16 Oct 2009) Log Message: ----------- * Support chord annotations as well. Now key annotations are expected to be of the form 0.121 123.1221 Key A or 0.121 123.1221 Silence and chord annotations are e.g. 0.121 2.32 A (and segmentations have a lower-case initial) Modified Paths: -------------- annotation-converter/converter.cpp Added Paths: ----------- annotation-converter/convert-all.sh Added: annotation-converter/convert-all.sh =================================================================== --- annotation-converter/convert-all.sh (rev 0) +++ annotation-converter/convert-all.sh 2009-10-16 16:28:51 UTC (rev 1660) @@ -0,0 +1,36 @@ +#!/bin/bash + +for y in Annotations*; do + for x in beat chordlab keylab seglab; do + if [ -d "$y/$x" ] ; then + find "$y/$x" -type f -print | \ + while read z ; do + case "$z" in + *.lab|*.txt) + echo ; echo $z + ./converter "$z" -o "${z%.*}.ttl" + ;; + *) ;; + esac + done + fi + done +done + +find Annotations* \( -name \*.lab -o -name \*.txt \) -print > /tmp/$$ +cat /tmp/$$ | grep -v allannotations | \ + sed -e 's/^[^\/]*\/[^\/]*\///' -e 's/\.[^.]*//' | \ + sort | uniq | \ + while read stem; do + echo "stem is $stem" + mkdir -p "all/`dirname \"$stem\"`" + rm -f "all/$stem.total" + grep "$stem" /tmp/$$ | while read x; do + if [ -f "$x" ]; then + cat "$x" >> "all/$stem.total" + fi + done + ./converter "all/$stem.total" -o "all/$stem.ttl" + rm -f "all/$stem.total" + done + Modified: annotation-converter/converter.cpp =================================================================== --- annotation-converter/converter.cpp 2009-10-16 08:31:02 UTC (rev 1659) +++ annotation-converter/converter.cpp 2009-10-16 16:28:51 UTC (rev 1660) @@ -188,6 +188,31 @@ } void +addChordSegment(Store &store, QString filename, float start, float end, QString label) +{ + static int segcount = 1; + QString c = QString("%1").arg(segcount++); + while (c.length() < 6) c = "0" + c; + + QUrl timelineUri = textFileTimelineMap[filename]; + + QUrl eventUri = store.expand(QString(":chord_%1").arg(c)); + store.add(Triple(eventUri, "a", store.expand("af:ChordSegment"))); + + Node intervalNode = store.addBlankNode(); + store.add(Triple(intervalNode, "a", store.expand("tl:Interval"))); + store.add(Triple(intervalNode, "tl:onTimeLine", timelineUri)); + + Node startNode = Node::fromVariant(QTime().addMSecs(lrintf(start * 1000))); + Node durationNode = Node::fromVariant(QTime().addMSecs(lrintf((end - start) * 1000))); + store.add(Triple(intervalNode, "tl:beginsAt", startNode)); + store.add(Triple(intervalNode, "tl:duration", durationNode)); + + store.add(Triple(eventUri, "event:time", intervalNode)); + store.add(Triple(eventUri, "rdfs:label", Node(Node::Literal, label))); +} + +void addStructuralSegment(Store &store, QString filename, float start, float end, QString label) { static int segcount = 1; @@ -244,16 +269,24 @@ addBeat(store, currentFilename, tokens[0].toFloat(), tokens[1].toInt()); } else if (tokens.size() == 3) { - if (tokens[2][0].isUpper()) { + if (tokens[2] == "Silence") { addKeySegment(store, currentFilename, tokens[0].toFloat(), tokens[1].toFloat(), tokens[2]); + } else if (tokens[2][0].isUpper()) { + addChordSegment(store, currentFilename, + tokens[0].toFloat(), tokens[1].toFloat(), + tokens[2]); } else { addStructuralSegment(store, currentFilename, tokens[0].toFloat(), tokens[1].toFloat(), tokens[2]); } - } + } else if (tokens.size() == 4) { + addKeySegment(store, currentFilename, + tokens[0].toFloat(), tokens[1].toFloat(), + tokens[3]); + } } else { currentFilename = line; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-10-16 08:31:14
|
Revision: 1659 http://sv1.svn.sourceforge.net/sv1/?rev=1659&view=rev Author: cannam Date: 2009-10-16 08:31:02 +0000 (Fri, 16 Oct 2009) Log Message: ----------- * Russian update from Alexandre Modified Paths: -------------- sonic-visualiser/trunk/sv/i18n/sonic-visualiser_en_GB.qm sonic-visualiser/trunk/sv/i18n/sonic-visualiser_en_GB.ts sonic-visualiser/trunk/sv/i18n/sonic-visualiser_en_US.qm sonic-visualiser/trunk/sv/i18n/sonic-visualiser_en_US.ts sonic-visualiser/trunk/sv/i18n/sonic-visualiser_ru.qm sonic-visualiser/trunk/sv/i18n/sonic-visualiser_ru.ts Modified: sonic-visualiser/trunk/sv/i18n/sonic-visualiser_en_GB.qm =================================================================== (Binary files differ) Modified: sonic-visualiser/trunk/sv/i18n/sonic-visualiser_en_GB.ts =================================================================== --- sonic-visualiser/trunk/sv/i18n/sonic-visualiser_en_GB.ts 2009-10-15 11:32:21 UTC (rev 1658) +++ sonic-visualiser/trunk/sv/i18n/sonic-visualiser_en_GB.ts 2009-10-16 08:31:02 UTC (rev 1659) @@ -1,9 +1,28 @@ <?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS><TS version="1.1" language="en"> +<!DOCTYPE TS> +<TS version="2.0" language="en"> <context> + <name>ActivityLog</name> + <message> + <location filename="../../widgets/ActivityLog.cpp" line="30"/> + <source>Activity Log</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../widgets/ActivityLog.cpp" line="35"/> + <source><p>Activity Log lists your interactions and other events within %1.</p></source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../widgets/ActivityLog.cpp" line="63"/> + <source>%1: %2</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>AddLayerCommand</name> <message> - <location filename="../../framework/Document.cpp" line="946"/> + <location filename="../../framework/Document.cpp" line="951"/> <source>Add %1 Layer</source> <translation type="unfinished"></translation> </message> @@ -25,6 +44,24 @@ </message> </context> <context> + <name>AudioCallbackPlaySource</name> + <message> + <location filename="../../audioio/AudioCallbackPlaySource.cpp" line="444"/> + <source>Play from %1</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../audioio/AudioCallbackPlaySource.cpp" line="459"/> + <source>Stop at %1</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../audioio/AudioCallbackPlaySource.cpp" line="1025"/> + <source>Change time-stretch factor to %1</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>AudioDial</name> <message> <location filename="../../widgets/AudioDial.cpp" line="416"/> @@ -37,26 +74,28 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/AudioDial.cpp" line="482"/> + <location filename="../../widgets/AudioDial.cpp" line="481"/> <source>New value for %1, from %2 to %3 %4:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/AudioDial.cpp" line="485"/> + <location filename="../../widgets/AudioDial.cpp" line="484"/> <source>New value for %1, from %2 to %3:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/AudioDial.cpp" line="490"/> + <location filename="../../widgets/AudioDial.cpp" line="489"/> <source>Enter a new value from %1 to %2 %3:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/AudioDial.cpp" line="517"/> + <location filename="../../widgets/AudioDial.cpp" line="492"/> + <location filename="../../widgets/AudioDial.cpp" line="516"/> <source>Enter a new value from %1 to %2:</source> <translation type="unfinished"></translation> </message> <message> + <location filename="../../widgets/AudioDial.cpp" line="499"/> <location filename="../../widgets/AudioDial.cpp" line="515"/> <source>Enter new value</source> <translation type="unfinished"></translation> @@ -65,27 +104,27 @@ <context> <name>AudioTargetFactory</name> <message> - <location filename="../../audioio/AudioTargetFactory.cpp" line="71"/> + <location filename="../../audioio/AudioTargetFactory.cpp" line="72"/> <source>(auto)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../audioio/AudioTargetFactory.cpp" line="75"/> + <location filename="../../audioio/AudioTargetFactory.cpp" line="76"/> <source>JACK Audio Connection Kit</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../audioio/AudioTargetFactory.cpp" line="79"/> + <location filename="../../audioio/AudioTargetFactory.cpp" line="80"/> <source>PulseAudio Server</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../audioio/AudioTargetFactory.cpp" line="83"/> + <location filename="../../audioio/AudioTargetFactory.cpp" line="84"/> <source>Core Audio Device</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../audioio/AudioTargetFactory.cpp" line="87"/> + <location filename="../../audioio/AudioTargetFactory.cpp" line="88"/> <source>Default Soundcard Device</source> <translation type="unfinished"></translation> </message> @@ -185,141 +224,171 @@ <context> <name>CSVFormatDialog</name> <message> - <location filename="../../widgets/CSVFormatDialog.cpp" line="38"/> + <location filename="../../widgets/CSVFormatDialog.cpp" line="39"/> <source>Select Data Format</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CSVFormatDialog.cpp" line="52"/> + <location filename="../../widgets/CSVFormatDialog.cpp" line="53"/> <source><b>Select Data Format</b><p>Please select the correct data format for this file.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CSVFormatDialog.cpp" line="55"/> + <location filename="../../widgets/CSVFormatDialog.cpp" line="56"/> <source>Each row specifies:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CSVFormatDialog.cpp" line="58"/> + <location filename="../../widgets/CSVFormatDialog.cpp" line="59"/> <source>A point in time</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CSVFormatDialog.cpp" line="59"/> + <location filename="../../widgets/CSVFormatDialog.cpp" line="60"/> <source>A value at a time</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CSVFormatDialog.cpp" line="60"/> + <location filename="../../widgets/CSVFormatDialog.cpp" line="61"/> <source>A set of values</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CSVFormatDialog.cpp" line="66"/> + <location filename="../../widgets/CSVFormatDialog.cpp" line="67"/> <source>The first column contains:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CSVFormatDialog.cpp" line="69"/> + <location filename="../../widgets/CSVFormatDialog.cpp" line="70"/> <source>Time, in seconds</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CSVFormatDialog.cpp" line="70"/> + <location filename="../../widgets/CSVFormatDialog.cpp" line="71"/> <source>Time, in audio sample frames</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CSVFormatDialog.cpp" line="71"/> + <location filename="../../widgets/CSVFormatDialog.cpp" line="72"/> <source>Data (rows are consecutive in time)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CSVFormatDialog.cpp" line="78"/> + <location filename="../../widgets/CSVFormatDialog.cpp" line="79"/> <source>Audio sample rate (Hz):</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CSVFormatDialog.cpp" line="100"/> + <location filename="../../widgets/CSVFormatDialog.cpp" line="101"/> <source>Frame increment between rows:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CSVFormatDialog.cpp" line="118"/> + <location filename="../../widgets/CSVFormatDialog.cpp" line="119"/> <source> Example data from file:</source> <translation type="unfinished"></translation> </message> - <message> - <location filename="../../widgets/CSVFormatDialog.cpp" line="127"/> - <source>OK</source> - <translation type="unfinished"></translation> - </message> - <message> - <location filename="../../widgets/CSVFormatDialog.cpp" line="131"/> - <source>Cancel</source> - <translation type="unfinished"></translation> - </message> </context> <context> <name>Colour3DPlotLayer</name> <message> - <location filename="../../layer/Colour3DPlotLayer.cpp" line="101"/> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="170"/> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="216"/> <source>Colour</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../layer/Colour3DPlotLayer.cpp" line="133"/> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="171"/> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="211"/> <source>Scale</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../layer/Colour3DPlotLayer.cpp" line="103"/> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="172"/> <source>Normalize Columns</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../layer/Colour3DPlotLayer.cpp" line="104"/> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="173"/> <source>Normalize Visible Area</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../layer/Colour3DPlotLayer.cpp" line="105"/> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="174"/> <source>Invert Vertical Scale</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../layer/Colour3DPlotLayer.cpp" line="196"/> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="175"/> + <source>Gain</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="176"/> + <source>Always Opaque</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="177"/> + <source>Smooth</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="178"/> + <source>Bin Scale</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="213"/> + <source>Bins</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="309"/> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="318"/> <source>Linear</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../layer/Colour3DPlotLayer.cpp" line="197"/> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="310"/> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="319"/> <source>Log</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../layer/Colour3DPlotLayer.cpp" line="198"/> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="311"/> <source>+/-1</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../layer/Colour3DPlotLayer.cpp" line="201"/> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="312"/> + <source>Absolute</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="322"/> <source><unknown></source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../layer/Colour3DPlotLayer.cpp" line="435"/> - <source>Time:<byte value="x9"/>%1 - %2 -Bin:<byte value="x9"/>%3 -Value:<byte value="x9"/>%4</source> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="329"/> + <source>dB</source> <translation type="unfinished"></translation> </message> + <message> + <location filename="../../layer/Colour3DPlotLayer.cpp" line="698"/> + <source>Time: %1 - %2 +Bin: %3 +Value: %4</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>ColourMapper</name> <message> - <location filename="../../layer/ColourMapper.cpp" line="65"/> + <location filename="../../layer/ColourMapper.cpp" line="48"/> + <location filename="../../layer/ColourMapper.cpp" line="66"/> <source><unknown></source> <translation type="unfinished"></translation> </message> @@ -378,67 +447,106 @@ <source>Printer</source> <translation type="unfinished"></translation> </message> + <message> + <location filename="../../layer/ColourMapper.cpp" line="63"/> + <source>High Gain</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>CommandHistory</name> <message> + <location filename="../../widgets/CommandHistory.cpp" line="56"/> <location filename="../../widgets/CommandHistory.cpp" line="61"/> + <location filename="../../widgets/CommandHistory.cpp" line="64"/> <source>&Undo</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CommandHistory.cpp" line="54"/> + <location filename="../../widgets/CommandHistory.cpp" line="57"/> <source>Ctrl+Z</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CommandHistory.cpp" line="55"/> + <location filename="../../widgets/CommandHistory.cpp" line="58"/> <source>Undo the last editing operation</source> <translation type="unfinished"></translation> </message> <message> + <location filename="../../widgets/CommandHistory.cpp" line="69"/> <location filename="../../widgets/CommandHistory.cpp" line="74"/> + <location filename="../../widgets/CommandHistory.cpp" line="77"/> <source>Re&do</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CommandHistory.cpp" line="67"/> + <location filename="../../widgets/CommandHistory.cpp" line="70"/> <source>Ctrl+Shift+Z</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CommandHistory.cpp" line="68"/> + <location filename="../../widgets/CommandHistory.cpp" line="71"/> <source>Redo the last operation that was undone</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CommandHistory.cpp" line="494"/> + <location filename="../../widgets/CommandHistory.cpp" line="344"/> + <source>Undo %1</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../widgets/CommandHistory.cpp" line="370"/> + <source>Redo %1</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../widgets/CommandHistory.cpp" line="503"/> <source>Nothing to undo</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CommandHistory.cpp" line="494"/> + <location filename="../../widgets/CommandHistory.cpp" line="503"/> <source>Nothing to redo</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CommandHistory.cpp" line="532"/> + <location filename="../../widgets/CommandHistory.cpp" line="519"/> + <location filename="../../widgets/CommandHistory.cpp" line="541"/> <source>&Undo %1</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/CommandHistory.cpp" line="533"/> + <location filename="../../widgets/CommandHistory.cpp" line="519"/> + <location filename="../../widgets/CommandHistory.cpp" line="542"/> <source>Re&do %1</source> <translation type="unfinished"></translation> </message> </context> <context> + <name>Dense3DModelPeakCache</name> + <message> + <location filename="../../data/model/Dense3DModelPeakCache.h" line="86"/> + <source>Dense 3-D Peak Cache</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>DenseThreeDimensionalModel</name> <message> - <location filename="../../data/model/DenseThreeDimensionalModel.h" line="107"/> + <location filename="../../data/model/DenseThreeDimensionalModel.h" line="110"/> <source>Dense 3-D</source> <translation type="unfinished"></translation> </message> + <message> + <location filename="../../data/model/DenseThreeDimensionalModel.h" line="127"/> + <source>Time</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../data/model/DenseThreeDimensionalModel.h" line="128"/> + <source>Frame</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>DenseTimeValueModel</name> @@ -449,9 +557,22 @@ </message> </context> <context> + <name>Document</name> + <message> + <location filename="../../framework/Document.cpp" line="269"/> + <source>Set main model to %1</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../framework/Document.cpp" line="271"/> + <source>Clear main model</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>EditableDenseThreeDimensionalModel</name> <message> - <location filename="../../data/model/EditableDenseThreeDimensionalModel.h" line="114"/> + <location filename="../../data/model/EditableDenseThreeDimensionalModel.h" line="139"/> <source>Editable Dense 3-D</source> <translation type="unfinished"></translation> </message> @@ -459,12 +580,12 @@ <context> <name>FFTModel</name> <message> - <location filename="../../data/model/FFTModel.h" line="184"/> + <location filename="../../data/model/FFTModel.h" line="187"/> <source>FFT</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/model/FFTModel.cpp" line="187"/> + <location filename="../../data/model/FFTModel.cpp" line="203"/> <source>%1 Hz</source> <translation type="unfinished"></translation> </message> @@ -487,7 +608,7 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/Fader.cpp" line="220"/> + <location filename="../../widgets/Fader.cpp" line="219"/> <source>Level: %1%2.%3%4 dB</source> <translation type="unfinished"></translation> </message> @@ -495,17 +616,17 @@ <context> <name>FeatureExtractionModelTransformer</name> <message> - <location filename="../../transform/FeatureExtractionModelTransformer.cpp" line="53"/> + <location filename="../../transform/FeatureExtractionModelTransformer.cpp" line="54"/> <source>No factory available for feature extraction plugin id "%1" (unknown plugin type, or internal error?)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../transform/FeatureExtractionModelTransformer.cpp" line="59"/> + <location filename="../../transform/FeatureExtractionModelTransformer.cpp" line="60"/> <source>Input model for feature extraction plugin "%1" is of wrong type (internal error?)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../transform/FeatureExtractionModelTransformer.cpp" line="65"/> + <location filename="../../transform/FeatureExtractionModelTransformer.cpp" line="66"/> <source>Failed to instantiate plugin "%1"</source> <translation type="unfinished"></translation> </message> @@ -515,7 +636,8 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../../transform/FeatureExtractionModelTransformer.cpp" line="126"/> + <location filename="../../transform/FeatureExtractionModelTransformer.cpp" line="112"/> + <location filename="../../transform/FeatureExtractionModelTransformer.cpp" line="127"/> <source>Failed to initialise feature extraction plugin "%1"</source> <translation type="unfinished"></translation> </message> @@ -530,7 +652,7 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../../transform/FeatureExtractionModelTransformer.cpp" line="149"/> + <location filename="../../transform/FeatureExtractionModelTransformer.cpp" line="150"/> <source>Plugin "%1" has no outputs</source> <translation type="unfinished"></translation> </message> @@ -541,430 +663,453 @@ </message> </context> <context> - <name>FileFinder</name> + <name>FileSource</name> <message> - <location filename="../../widgets/FileFinder.cpp" line="193"/> - <source>Select file</source> + <location filename="../../data/fileio/FileSource.cpp" line="93"/> + <location filename="../../data/fileio/FileSource.cpp" line="171"/> + <location filename="../../data/fileio/FileSource.cpp" line="203"/> + <source>Unsupported scheme in URL</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="194"/> - <source>All files (*.*)</source> + <location filename="../../data/fileio/FileSource.cpp" line="360"/> + <source>Downloading %1...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="200"/> - <source>Select a session file</source> + <location filename="../../data/fileio/FileSource.cpp" line="687"/> + <source>Failed to connect to FTP server</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="201"/> - <source>Sonic Visualiser session files (*.sv) -All files (*.*)</source> + <location filename="../../data/fileio/FileSource.cpp" line="689"/> + <source>Login failed</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="73"/> - <source>Audio files (%1) -All files (*.*)</source> + <location filename="../../data/fileio/FileSource.cpp" line="691"/> + <source>Failed to change to correct directory</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="78"/> - <source>All supported files (%1 %2) -Sonic Visualiser Layer XML files (*.svl) -Comma-separated data files (*.csv) -Space-separated .lab files (*.lab) -RDF files (%3) -MIDI files (*.mid) -Text files (*.txt) -All files (*.*)</source> + <location filename="../../data/fileio/FileSource.cpp" line="693"/> + <source>FTP download aborted</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="83"/> - <source>All supported files (%1 %2) -Sonic Visualiser Layer XML files (*.svl) -Comma-separated data files (*.csv) -Space-separated .lab files (*.lab) -RDF files (%3) -Text files (*.txt) -All files (*.*)</source> + <location filename="../../data/fileio/FileSource.cpp" line="713"/> + <source>Download cancelled</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="89"/> - <source>All supported files (*.sv %1) -Sonic Visualiser session files (*.sv) -Audio files (%1) -All files (*.*)</source> + <location filename="../../data/fileio/FileSource.cpp" line="744"/> + <source>Failed to create local file %1</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="102"/> - <source>Image files (%1) -All files (*.*)</source> + <location filename="../../data/fileio/FileSource.cpp" line="747"/> + <source>File contains no data!</source> <translation type="unfinished"></translation> </message> +</context> +<context> + <name>I</name> <message> - <location filename="../../widgets/FileFinder.cpp" line="109"/> - <source>All supported files (*.sv %1 %2 %3) -Sonic Visualiser session files (*.sv) -Audio files (%1) -Layer files (%2) -All files (*.*)</source> + <location filename="../../data/model/IntervalModel.h" line="103"/> + <source>Edit Data</source> <translation type="unfinished"></translation> </message> +</context> +<context> + <name>ImageDialog</name> <message> - <location filename="../../widgets/FileFinder.cpp" line="149"/> - <source>File does not exist</source> + <location filename="../../widgets/ImageDialog.cpp" line="49"/> + <source>Image</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="150"/> - <source>File "%1" does not exist</source> + <location filename="../../widgets/ImageDialog.cpp" line="56"/> + <source>Label:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="155"/> - <source>File is not readable</source> + <location filename="../../widgets/ImageDialog.cpp" line="63"/> + <source>File or URL:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="156"/> - <source>File "%1" can not be read</source> + <location filename="../../widgets/ImageDialog.cpp" line="73"/> + <source>Browse...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="311"/> - <source>Directory selected</source> + <location filename="../../widgets/ImageDialog.cpp" line="79"/> + <source>Preview</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="312"/> - <source>File "%1" is a directory</source> + <location filename="../../widgets/ImageDialog.cpp" line="187"/> + <source>Unsupported scheme in URL</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="167"/> - <source>Non-file selected</source> + <location filename="../../widgets/ImageDialog.cpp" line="188"/> + <source>The URL scheme "%1" is not supported</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="168"/> - <source>Path "%1" is not a file</source> + <location filename="../../widgets/ImageDialog.cpp" line="192"/> + <source>Opening image URL...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="173"/> - <source>File is empty</source> + <location filename="../../widgets/ImageDialog.cpp" line="196"/> + <source>File download failed</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="174"/> - <source>File "%1" is empty</source> + <location filename="../../widgets/ImageDialog.cpp" line="197"/> + <source>Failed to download URL "%1": %2</source> <translation type="unfinished"></translation> </message> +</context> +<context> + <name>ImageLayer</name> <message> - <location filename="../../widgets/FileFinder.cpp" line="229"/> - <source>Select a file to export to</source> + <location filename="../../layer/ImageLayer.cpp" line="182"/> + <source>In progress</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="208"/> - <source>WAV audio files (*.wav) -All files (*.*)</source> + <location filename="../../layer/ImageLayer.cpp" line="606"/> + <location filename="../../layer/ImageLayer.cpp" line="711"/> + <source>Select image</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="214"/> - <source>Sonic Visualiser Layer XML files (*.svl) -Comma-separated data files (*.csv) -MIDI files (*.mid) -Text files (*.txt) -All files (*.*)</source> + <location filename="../../layer/ImageLayer.cpp" line="678"/> + <source>Move Image</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="220"/> - <source>Sonic Visualiser Layer XML files (*.svl) -Comma-separated data files (*.csv) -Text files (*.txt) -All files (*.*)</source> + <location filename="../../layer/ImageLayer.cpp" line="735"/> + <source>Drag Selection</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="230"/> - <source>Portable Network Graphics files (*.png) -All files (*.*)</source> + <location filename="../../layer/ImageLayer.cpp" line="760"/> + <source>Resize Selection</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="317"/> - <source>File exists</source> + <location filename="../../layer/ImageLayer.cpp" line="794"/> + <source>Delete Selection</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="318"/> - <source>The file "%1" already exists. -Do you want to overwrite it?</source> + <location filename="../../layer/ImageLayer.cpp" line="837"/> + <source>Re-align pasted items?</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="450"/> - <source>Audio file "%1" could not be opened. -Do you want to locate it?</source> + <location filename="../../layer/ImageLayer.cpp" line="838"/> + <source>The items you are pasting came from a layer with different source material from this one. Do you want to re-align them in time, to match the source material for this layer?</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="452"/> - <source>File "%1" could not be opened. -Do you want to locate it?</source> + <location filename="../../layer/ImageLayer.cpp" line="852"/> + <source>Paste</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="462"/> - <source>Failed to open file</source> + <location filename="../../layer/ImageLayer.cpp" line="884"/> + <source>New Point</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="464"/> - <source>Locate file...</source> + <location filename="../../layer/ImageLayer.cpp" line="915"/> + <source>Opening image URL...</source> <translation type="unfinished"></translation> </message> +</context> +<context> + <name>ImageModel</name> <message> - <location filename="../../widgets/FileFinder.cpp" line="465"/> - <source>Use URL...</source> + <location filename="../../data/model/ImageModel.h" line="96"/> + <location filename="../../data/model/ImageModel.h" line="154"/> + <source>Image</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="466"/> - <source>Cancel</source> + <location filename="../../data/model/ImageModel.h" line="124"/> + <source>Edit Image</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="485"/> - <source>Use URL</source> + <location filename="../../data/model/ImageModel.h" line="152"/> + <source>Time</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="486"/> - <source>Please enter the URL to use for this file:</source> + <location filename="../../data/model/ImageModel.h" line="153"/> + <source>Frame</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="494"/> - <source>Failed to open location</source> + <location filename="../../data/model/ImageModel.h" line="155"/> + <source>Label</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/FileFinder.cpp" line="495"/> - <source>URL "%1" could not be opened</source> + <location filename="../../data/model/ImageModel.h" line="156"/> + <source>Unknown</source> <translation type="unfinished"></translation> </message> + <message> + <location filename="../../data/model/ImageModel.h" line="187"/> + <source>Edit Data</source> + <translation type="unfinished"></translation> + </message> </context> <context> - <name>FileSource</name> + <name>InteractiveFileFinder</name> <message> - <location filename="../../data/fileio/FileSource.cpp" line="159"/> - <source>Unsupported scheme in URL</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="52"/> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="192"/> + <source>Select file</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/FileSource.cpp" line="302"/> - <source>Downloading %1...</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="53"/> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="193"/> + <source>All files (*.*)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/FileSource.cpp" line="586"/> - <source>Failed to connect to FTP server</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="59"/> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="199"/> + <source>Select a session file</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/FileSource.cpp" line="588"/> - <source>Login failed</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="60"/> + <source>Sonic Visualiser session files (*.sv) +RDF files (%1) +All files (*.*)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/FileSource.cpp" line="590"/> - <source>Failed to change to correct directory</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="66"/> + <source>Audio files (%1) +All files (*.*)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/FileSource.cpp" line="592"/> - <source>FTP download aborted</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="72"/> + <source>All supported files (%1 %2) +Sonic Visualiser Layer XML files (*.svl) +Comma-separated data files (*.csv) +Space-separated .lab files (*.lab) +RDF files (%2) +MIDI files (*.mid) +Text files (*.txt) +All files (*.*)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/FileSource.cpp" line="612"/> - <source>Download cancelled</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="79"/> + <source>All supported files (%1 %2) +Sonic Visualiser Layer XML files (*.svl) +Comma-separated data files (*.csv) +Space-separated .lab files (*.lab) +RDF files (%2) +Text files (*.txt) +All files (*.*)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/FileSource.cpp" line="643"/> - <source>Failed to create local file %1</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="86"/> + <source>All supported files (*.sv %1 %2) +Sonic Visualiser session files (*.sv) +Audio files (%2) +RDF files (%1) +All files (*.*)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/FileSource.cpp" line="646"/> - <source>File contains no data!</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="101"/> + <source>Image files (%1) +All files (*.*)</source> <translation type="unfinished"></translation> </message> -</context> -<context> - <name>I</name> <message> - <location filename="../../data/model/IntervalModel.h" line="103"/> - <source>Edit Data</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="107"/> + <source>All supported files (*.sv %1 %2 %3) +Sonic Visualiser session files (*.sv) +Audio files (%1) +Layer files (%2) +RDF files (%3) +All files (*.*)</source> <translation type="unfinished"></translation> </message> -</context> -<context> - <name>ImageDialog</name> <message> - <location filename="../../widgets/ImageDialog.cpp" line="49"/> - <source>Image</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="148"/> + <source>File does not exist</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/ImageDialog.cpp" line="56"/> - <source>Label:</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="149"/> + <source><b>File not found</b><p>File "%1" does not exist</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/ImageDialog.cpp" line="63"/> - <source>File or URL:</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="154"/> + <source>File is not readable</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/ImageDialog.cpp" line="73"/> - <source>Browse...</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="155"/> + <source><b>File is not readable</b><p>File "%1" can not be read</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/ImageDialog.cpp" line="79"/> - <source>Preview</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="160"/> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="312"/> + <source>Directory selected</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/ImageDialog.cpp" line="187"/> - <source>Unsupported scheme in URL</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="161"/> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="313"/> + <source><b>Directory selected</b><p>File "%1" is a directory</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/ImageDialog.cpp" line="189"/> - <source>The URL scheme "%1" is not supported</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="166"/> + <source>Non-file selected</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/ImageDialog.cpp" line="192"/> - <source>Opening image URL...</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="167"/> + <source><b>Not a file</b><p>Path "%1" is not a file</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/ImageDialog.cpp" line="196"/> - <source>File download failed</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="172"/> + <source>File is empty</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../widgets/ImageDialog.cpp" line="198"/> - <source>Failed to download URL "%1": %2</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="173"/> + <source><b>File is empty</b><p>File "%1" is empty</source> <translation type="unfinished"></translation> </message> -</context> -<context> - <name>ImageLayer</name> <message> - <location filename="../../layer/ImageLayer.cpp" line="182"/> - <source>In progress</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="200"/> + <source>Sonic Visualiser session files (*.sv) +All files (*.*)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../layer/ImageLayer.cpp" line="710"/> - <source>Select image</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="206"/> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="212"/> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="218"/> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="228"/> + <source>Select a file to export to</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../layer/ImageLayer.cpp" line="677"/> - <source>Move Image</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="207"/> + <source>WAV audio files (*.wav) +All files (*.*)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../layer/ImageLayer.cpp" line="734"/> - <source>Drag Selection</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="213"/> + <source>Sonic Visualiser Layer XML files (*.svl) +Comma-separated data files (*.csv) +RDF/Turtle files (%1) +MIDI files (*.mid) +Text files (*.txt) +All files (*.*)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../layer/ImageLayer.cpp" line="759"/> - <source>Resize Selection</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="219"/> + <source>Sonic Visualiser Layer XML files (*.svl) +Comma-separated data files (*.csv) +RDF/Turtle files (%1) +Text files (*.txt) +All files (*.*)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../layer/ImageLayer.cpp" line="793"/> - <source>Delete Selection</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="229"/> + <source>Portable Network Graphics files (*.png) +All files (*.*)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../layer/ImageLayer.cpp" line="836"/> - <source>Re-align pasted items?</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="318"/> + <source>File exists</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../layer/ImageLayer.cpp" line="837"/> - <source>The items you are pasting came from a layer with different source material from this one. Do you want to re-align them in time, to match the source material for this layer?</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="319"/> + <source><b>File exists</b><p>The file "%1" already exists. +Do you want to overwrite it?</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../layer/ImageLayer.cpp" line="851"/> - <source>Paste</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="451"/> + <source><b>File not found</b><p>Audio file "%1" could not be opened. +Do you want to locate it?</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../layer/ImageLayer.cpp" line="883"/> - <source>New Point</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="453"/> + <source><b>File not found</b><p>File "%1" could not be opened. +Do you want to locate it?</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../layer/ImageLayer.cpp" line="916"/> - <source>Opening image URL...</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="463"/> + <source>Failed to open file</source> <translation type="unfinished"></translation> </message> -</context> -<context> - <name>ImageModel</name> <message> - <location filename="../../data/model/ImageModel.h" line="154"/> - <source>Image</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="465"/> + <source>Locate file...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/model/ImageModel.h" line="124"/> - <source>Edit Image</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="466"/> + <source>Use URL...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/model/ImageModel.h" line="152"/> - <source>Time</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="467"/> + <source>Cancel</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/model/ImageModel.h" line="153"/> - <source>Frame</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="486"/> + <source>Use URL</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/model/ImageModel.h" line="155"/> - <source>Label</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="487"/> + <source>Please enter the URL to use for this file:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/model/ImageModel.h" line="156"/> - <source>Unknown</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="495"/> + <source>Failed to open location</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/model/ImageModel.h" line="187"/> - <source>Edit Data</source> + <location filename="../../widgets/InteractiveFileFinder.cpp" line="496"/> + <source><b>Failed to open location</b><p>URL "%1" could not be opened</source> <translation type="unfinished"></translation> </message> </context> @@ -981,16 +1126,19 @@ <translation type="unfinished"></translation> </message> <message> + <location filename="../../widgets/ItemEditDialog.cpp" line="73"/> <location filename="../../widgets/ItemEditDialog.cpp" line="104"/> <source> frames</source> <translation type="unfinished"></translation> </message> <message> + <location filename="../../widgets/ItemEditDialog.cpp" line="82"/> <location filename="../../widgets/ItemEditDialog.cpp" line="113"/> <source> sec</source> <translation type="unfinished"></translation> </message> <message> + <location filename="../../widgets/ItemEditDialog.cpp" line="89"/> <location filename="../../widgets/ItemEditDialog.cpp" line="120"/> <source> usec</source> <translation type="unfinished"></translation> @@ -1034,6 +1182,7 @@ <context> <name>KeyReference</name> <message> + <location filename="../../widgets/KeyReference.cpp" line="61"/> <location filename="../../widgets/KeyReference.cpp" line="92"/> <source>&</source> <translation type="unfinished"></translation> @@ -1158,6 +1307,8 @@ <translation type="unfinished"></translation> </message> <message> + <location filename="../../layer/LayerFactory.cpp" line="71"/> + <location filename="../../layer/LayerFactory.cpp" line="87"/> <location filename="../../layer/LayerFactory.cpp" line="91"/> <source>Spectrogram</source> <translation type="unfinished"></translation> @@ -1306,92 +1457,102 @@ <context> <name>MIDIFileReader</name> <message> - <location filename="../../data/fileio/MIDIFileReader.cpp" line="109"/> + <location filename="../../data/fileio/MIDIFileReader.cpp" line="112"/> <source>Wrong length for long data in MIDI stream (%1, should be %2)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/MIDIFileReader.cpp" line="124"/> + <location filename="../../data/fileio/MIDIFileReader.cpp" line="127"/> <source>Wrong length for int data in MIDI stream (%1, should be %2)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/MIDIFileReader.cpp" line="141"/> + <location filename="../../data/fileio/MIDIFileReader.cpp" line="144"/> <source>getMIDIByte called but no MIDI file open</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/MIDIFileReader.cpp" line="174"/> + <location filename="../../data/fileio/MIDIFileReader.cpp" line="148"/> + <location filename="../../data/fileio/MIDIFileReader.cpp" line="177"/> <source>End of MIDI file encountered while reading</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/MIDIFileReader.cpp" line="149"/> + <location filename="../../data/fileio/MIDIFileReader.cpp" line="152"/> <source>Attempt to get more bytes than expected on Track</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/MIDIFileReader.cpp" line="194"/> + <location filename="../../data/fileio/MIDIFileReader.cpp" line="161"/> + <location filename="../../data/fileio/MIDIFileReader.cpp" line="197"/> <source>Attempt to read past MIDI file end</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/MIDIFileReader.cpp" line="170"/> + <location filename="../../data/fileio/MIDIFileReader.cpp" line="173"/> <source>getMIDIBytes called but no MIDI file open</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/MIDIFileReader.cpp" line="178"/> + <location filename="../../data/fileio/MIDIFileReader.cpp" line="181"/> <source>Attempt to get more bytes than available on Track (%1, only have %2)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/MIDIFileReader.cpp" line="211"/> + <location filename="../../data/fileio/MIDIFileReader.cpp" line="214"/> <source>getNumberFromMIDIBytes called but no MIDI file open</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/MIDIFileReader.cpp" line="245"/> + <location filename="../../data/fileio/MIDIFileReader.cpp" line="248"/> <source>skipToNextTrack called but no MIDI file open</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/MIDIFileReader.cpp" line="485"/> + <location filename="../../data/fileio/MIDIFileReader.cpp" line="479"/> <source>Invalid event code %1 found</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/MIDIFileReader.cpp" line="500"/> + <location filename="../../data/fileio/MIDIFileReader.cpp" line="494"/> <source>Running status used for first event in track</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/MIDIFileReader.cpp" line="818"/> + <location filename="../../data/fileio/MIDIFileReader.cpp" line="812"/> <source>MIDI file "%1" has no notes in any track</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/MIDIFileReader.cpp" line="841"/> + <location filename="../../data/fileio/MIDIFileReader.cpp" line="835"/> <source> - uses GM percussion channel</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/MIDIFileReader.cpp" line="846"/> + <location filename="../../data/fileio/MIDIFileReader.cpp" line="839"/> <source>Track %1 (%2)%3</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../data/fileio/MIDIFileReader.cpp" line="849"/> + <location filename="../../data/fileio/MIDIFileReader.cpp" line="843"/> <source>Track %1 (untitled)%3</source> <translation type="unfinished"></translation> </message> <message> - ... [truncated message content] |
From: <ca...@us...> - 2009-10-15 11:32:36
|
Revision: 1658 http://sv1.svn.sourceforge.net/sv1/?rev=1658&view=rev Author: cannam Date: 2009-10-15 11:32:21 +0000 (Thu, 15 Oct 2009) Log Message: ----------- * When importing regions without values, generate a different value for each distinct label Modified Paths: -------------- sonic-visualiser/trunk/rdf/RDFImporter.cpp Modified: sonic-visualiser/trunk/rdf/RDFImporter.cpp =================================================================== --- sonic-visualiser/trunk/rdf/RDFImporter.cpp 2009-10-15 11:05:55 UTC (rev 1657) +++ sonic-visualiser/trunk/rdf/RDFImporter.cpp 2009-10-15 11:32:21 UTC (rev 1658) @@ -60,6 +60,8 @@ std::map<QString, Model *> m_audioModelMap; int m_sampleRate; + std::map<Model *, std::map<QString, float> > m_labelValueMap; + static bool m_prefixesLoaded; static void loadPrefixes(ProgressReporter *reporter); @@ -243,6 +245,8 @@ fs->getLocation(), m_uristring); if (path != "") { + std::cerr << "File finder returns: \"" << path.toStdString() + << "\"" << std::endl; delete fs; fs = new FileSource(path, reporter); if (!fs->isAvailable()) { @@ -938,14 +942,23 @@ RegionModel *rm = dynamic_cast<RegionModel *>(model); if (rm) { + float value = 0.f; + if (values.empty()) { + // no values? map each unique label to a distinct value + if (m_labelValueMap[model].find(label) == m_labelValueMap[model].end()) { + m_labelValueMap[model][label] = rm->getValueMaximum() + 1.f; + } + value = m_labelValueMap[model][label]; + } else { + value = values[0]; + } if (haveDuration) { - RegionModel::Point point - (ftime, values.empty() ? 0.f : values[0], fduration, label); + RegionModel::Point point(ftime, value, fduration, label); rm->addPoint(point); } else { // This won't actually happen -- we only create region models // if we do have duration -- but just for completeness - float value = 0.f, duration = 1.f; + float duration = 1.f; if (!values.empty()) { value = values[0]; if (values.size() > 1) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-10-15 11:06:03
|
Revision: 1657 http://sv1.svn.sourceforge.net/sv1/?rev=1657&view=rev Author: cannam Date: 2009-10-15 11:05:55 +0000 (Thu, 15 Oct 2009) Log Message: ----------- * Add -o option for output file Modified Paths: -------------- annotation-converter/converter.cpp Modified: annotation-converter/converter.cpp =================================================================== --- annotation-converter/converter.cpp 2009-10-15 10:52:38 UTC (rev 1656) +++ annotation-converter/converter.cpp 2009-10-15 11:05:55 UTC (rev 1657) @@ -20,7 +20,8 @@ void usage(char *name) { - cerr << "Usage: " << name << " file.lab [file2.lab ...]" << endl; + cerr << "Usage: " << name << " file.lab [file2.lab ...] [-o file.ttl]" << endl; + cerr << "Default output filename is annotations.ttl" << endl; exit(2); } @@ -232,7 +233,6 @@ QStringList tokens = line.split(QRegExp("\\s+"), QString::SkipEmptyParts); if (tokens.empty()) { - cerr << "(empty line)" << endl; continue; } @@ -277,14 +277,22 @@ store.addPrefix("tl", "http://purl.org/NET/c4dm/timeline.owl#"); store.addPrefix("vamp", "http://purl.org/ontology/vamp/"); + QString outfile = "annotations.ttl"; + for (int i = 1; i < argc; ++i) { + if (!strcmp(argv[i], "-o") && i < argc-1) { + ++i; + outfile = argv[i]; + cerr << "will write to file: " << outfile.toStdString() << endl; + continue; + } cerr << "reading file: " << argv[i] << endl; readFile(store, argv[i]); } cerr << "done, saving..." << endl; - store.save("annotations.ttl"); + store.save(outfile); return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-10-15 10:52:48
|
Revision: 1656 http://sv1.svn.sourceforge.net/sv1/?rev=1656&view=rev Author: cannam Date: 2009-10-15 10:52:38 +0000 (Thu, 15 Oct 2009) Log Message: ----------- * Include the path of a WAV file (imaginary) from which the features were extracted. Handy because it makes SV prompt for a WAV file when we import the features Modified Paths: -------------- annotation-converter/converter.cpp Modified: annotation-converter/converter.cpp =================================================================== --- annotation-converter/converter.cpp 2009-10-15 10:50:43 UTC (rev 1655) +++ annotation-converter/converter.cpp 2009-10-15 10:52:38 UTC (rev 1656) @@ -63,7 +63,8 @@ return; } - QString track = disentangle(QFileInfo(filename).completeBaseName()); + QString base = QFileInfo(filename).completeBaseName(); + QString track = disentangle(base); QStringList elements = filename.split("/"); QString artist, album; @@ -81,12 +82,26 @@ store.add(Triple(trackUri, "a", store.expand("mo:Track"))); store.add(Triple(trackUri, "dc:title", Node(Node::Literal, track))); - Node sourceFileNode = store.addBlankNode(); - store.add(Triple(trackUri, "mo:available_as", sourceFileNode)); - store.add(Triple(sourceFileNode, "a", store.expand("mo:AudioFile"))); + QString imaginaryFileName; + if (artist != "") { + if (album != "") { + imaginaryFileName = QString("%1/%2/%3.wav") + .arg(artist).arg(album).arg(base); + } else { + imaginaryFileName = QString("%1/%2.wav") + .arg(artist).arg(base); + } + } else { + imaginaryFileName = QString("%1.wav") + .arg(base); + } + QUrl imaginaryFileUri = QUrl::fromLocalFile(imaginaryFileName); + QString encFileUri = QString::fromAscii(imaginaryFileUri.toEncoded()); + store.add(Triple(trackUri, "mo:available_as", Node(Node::URI, encFileUri))); + store.add(Triple(encFileUri, "a", store.expand("mo:AudioFile"))); Node signalNode = store.addBlankNode(); - store.add(Triple(sourceFileNode, "mo:encodes", signalNode)); + store.add(Triple(encFileUri, "mo:encodes", signalNode)); store.add(Triple(signalNode, "a", store.expand("mo:Signal"))); QUrl timelineUri = store.getUniqueUri(":timeline_"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-10-15 10:51:01
|
Revision: 1655 http://sv1.svn.sourceforge.net/sv1/?rev=1655&view=rev Author: cannam Date: 2009-10-15 10:50:43 +0000 (Thu, 15 Oct 2009) Log Message: ----------- * RDF importer: Features that are on different timeline URIs should go into separate models (_not_ just on separate signal URIs as there may not be any meaningful signal URIs) * FileSource: if a file is not found, try again assuming its name is encoded (not just in tolerant mode) Modified Paths: -------------- sonic-visualiser/trunk/data/fileio/FileSource.cpp sonic-visualiser/trunk/framework/MainWindowBase.cpp sonic-visualiser/trunk/rdf/RDFImporter.cpp Modified: sonic-visualiser/trunk/data/fileio/FileSource.cpp =================================================================== --- sonic-visualiser/trunk/data/fileio/FileSource.cpp 2009-10-13 16:22:42 UTC (rev 1654) +++ sonic-visualiser/trunk/data/fileio/FileSource.cpp 2009-10-15 10:50:43 UTC (rev 1655) @@ -99,9 +99,9 @@ if (!isRemote() && !isAvailable()) { #ifdef DEBUG_FILE_SOURCE - std::cerr << "FileSource::FileSource: Failed to open local file with URL \"" << m_url.toString().toStdString() << "; trying again with tolerant encoding" << std::endl; + std::cerr << "FileSource::FileSource: Failed to open local file with URL \"" << m_url.toString().toStdString() << "; trying again assuming filename was encoded" << std::endl; #endif - m_url = QUrl(fileOrUrl, QUrl::TolerantMode); + m_url = QUrl::fromEncoded(fileOrUrl.toAscii()); init(); } Modified: sonic-visualiser/trunk/framework/MainWindowBase.cpp =================================================================== --- sonic-visualiser/trunk/framework/MainWindowBase.cpp 2009-10-13 16:22:42 UTC (rev 1654) +++ sonic-visualiser/trunk/framework/MainWindowBase.cpp 2009-10-15 10:50:43 UTC (rev 1655) @@ -1620,6 +1620,8 @@ { size_t rate = 0; + std::cerr << "MainWindowBase::openLayersFromRDF" << std::endl; + ProgressDialog dialog(tr("Importing from RDF..."), true, 2000, this); connect(&dialog, SIGNAL(showing()), this, SIGNAL(hideSplash())); @@ -1647,6 +1649,9 @@ dialog.setMessage(tr("Importing from RDF...")); if (models.empty()) { + QMessageBox::critical + (this, tr("Failed to import RDF"), + tr("<b>Failed to import RDF</b><p>No suitable data models found for import from RDF document at \"%1\"</p>").arg(source.getLocation())); return FileOpenFailed; } Modified: sonic-visualiser/trunk/rdf/RDFImporter.cpp =================================================================== --- sonic-visualiser/trunk/rdf/RDFImporter.cpp 2009-10-13 16:22:42 UTC (rev 1654) +++ sonic-visualiser/trunk/rdf/RDFImporter.cpp 2009-10-15 10:50:43 UTC (rev 1655) @@ -151,7 +151,8 @@ getDataModelsAudio(models, reporter); if (m_sampleRate == 0) { - std::cerr << "RDFImporter::getDataModels: invalid sample rate from audio" << std::endl; + m_errorString = QString("Invalid audio data model (is audio file format supported?)"); + std::cerr << m_errorString.toStdString() << std::endl; return models; } @@ -216,7 +217,16 @@ QString signal = results[i]["signal"].value; QString source = results[i]["source"].value; + std::cerr << "NOTE: Seeking signal source \"" << source.toStdString() + << "\"..." << std::endl; + FileSource *fs = new FileSource(source, reporter); + if (fs->isAvailable()) { + std::cerr << "NOTE: Source is available: Local filename is \"" + << fs->getLocalFilename().toStdString() + << "\"..." << std::endl; + } + #ifdef NO_SV_GUI if (!fs->isAvailable()) { m_errorString = QString("Signal source \"%1\" is not available").arg(source); @@ -225,6 +235,8 @@ } #else if (!fs->isAvailable()) { + std::cerr << "NOTE: Signal source \"" << source.toStdString() + << "\" is not available, using file finder..." << std::endl; FileFinder *ff = FileFinder::getInstance(); if (ff) { QString path = ff->find(FileFinder::AudioFile, @@ -576,7 +588,7 @@ QString queryString = prefixes + QString( - " SELECT ?signal ?timed_thing ?event_type ?value" + " SELECT ?signal ?timed_thing ?timeline ?event_type ?value" " FROM <%1>" " WHERE {" @@ -584,8 +596,8 @@ " ?signal a mo:Signal ." " ?signal mo:time ?interval ." - " ?interval tl:onTimeLine ?tl ." - " ?time tl:onTimeLine ?tl ." + " ?interval tl:onTimeLine ?timeline ." + " ?time tl:onTimeLine ?timeline ." " ?timed_thing event:time ?time ." " ?timed_thing a ?event_type ." @@ -596,6 +608,10 @@ ).arg(m_uristring); + //!!! NB we're using rather old terminology for these things, apparently: + // beginsAt -> start + // onTimeLine -> timeline + QString timeQueryString = prefixes + QString( " SELECT ?time FROM <%1> " @@ -674,7 +690,7 @@ about it. Then return only non-empty models. */ - // Map from signal source to event type to dimensionality to + // Map from timeline uri to event type to dimensionality to // presence of duration to model ptr. Whee! std::map<QString, std::map<QString, std::map<int, std::map<bool, Model *> > > > modelMap; @@ -686,6 +702,7 @@ } QString source = results[i]["signal"].value; + QString timeline = results[i]["timeline"].value; QString type = results[i]["event_type"].value; QString thinguri = results[i]["timed_thing"].value; @@ -747,8 +764,8 @@ Model *model = 0; - if (modelMap[source][type][dimensions].find(haveDuration) == - modelMap[source][type][dimensions].end()) { + if (modelMap[timeline][type][dimensions].find(haveDuration) == + modelMap[timeline][type][dimensions].end()) { /* std::cerr << "Creating new model: source = " << source.toStdString() @@ -836,11 +853,11 @@ (s, titleQuery, "title").value; if (title != "") model->setObjectName(title); - modelMap[source][type][dimensions][haveDuration] = model; + modelMap[timeline][type][dimensions][haveDuration] = model; models.push_back(model); } - model = modelMap[source][type][dimensions][haveDuration]; + model = modelMap[timeline][type][dimensions][haveDuration]; if (model) { long ftime = RealTime::realTime2Frame(time, m_sampleRate); @@ -1001,6 +1018,9 @@ } } + std::cerr << "NOTE: RDFImporter::identifyDocumentType: haveAudio = " + << haveAudio << std::endl; + value = SimpleSPARQLQuery::singleResultQuery (SimpleSPARQLQuery::QueryFromSingleSource, @@ -1032,6 +1052,9 @@ } } + std::cerr << "NOTE: RDFImporter::identifyDocumentType: haveAnnotations = " + << haveAnnotations << std::endl; + SimpleSPARQLQuery::closeSingleSource(url); if (haveAudio) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-10-13 16:22:59
|
Revision: 1654 http://sv1.svn.sourceforge.net/sv1/?rev=1654&view=rev Author: cannam Date: 2009-10-13 16:22:42 +0000 (Tue, 13 Oct 2009) Log Message: ----------- * .lab -> RDF annotation converter program (first draft) Added Paths: ----------- annotation-converter/converter.cpp annotation-converter/converter.pro Added: annotation-converter/converter.cpp =================================================================== --- annotation-converter/converter.cpp (rev 0) +++ annotation-converter/converter.cpp 2009-10-13 16:22:42 UTC (rev 1654) @@ -0,0 +1,276 @@ + +#include <dataquay/BasicStore.h> + +#include <QString> +#include <QFile> +#include <QStringList> +#include <QTextStream> +#include <QFileInfo> +#include <QRegExp> +#include <QTime> + +#include <iostream> +#include <stdlib.h> + +#include <math.h> + +using namespace Dataquay; +using namespace std; + +void +usage(char *name) +{ + cerr << "Usage: " << name << " file.lab [file2.lab ...]" << endl; + exit(2); +} + +QString +disentangle(QString name) +{ + // e.g. + // + // 04_-_Rock_and_Roll_Music + // -> Rock and Roll Music + // + // 1-09 Don't Stop 'Til You Get Enough (2003 Edit) + // -> Don't Stop 'Til You Get Enough (2003 Edit) + // + // CD1_-_02_-_Dear_Prudence + // -> Dear Prudence + + name.replace(QRegExp("^(CD)?(\\d_?\\-_?)?\\d\\d(_\\-)?"), ""); + name.replace("_", " "); + name.replace(QRegExp("^\\s+"), ""); + return name; +} + +static +QHash<QString, QUrl> artistUriMap; + +static +QHash<QString, QHash<QString, QUrl> > artistAlbumUriMap; + +static +QHash<QString, QUrl> textFileTimelineMap; + +static +QHash<QString, QHash<QString, QHash<QString, QUrl> > > artistAlbumTrackTimelineMap; + +void +checkTrack(Store &store, QString filename) +{ + if (textFileTimelineMap.contains(filename)) { + return; + } + + QString track = disentangle(QFileInfo(filename).completeBaseName()); + + QStringList elements = filename.split("/"); + QString artist, album; + if (elements.size() >= 3) { + artist = disentangle(elements[elements.size()-3]); + album = disentangle(elements[elements.size()-2]); + } + + if (artistAlbumTrackTimelineMap[artist][album][track] != QUrl()) { + textFileTimelineMap[filename] = artistAlbumTrackTimelineMap[artist][album][track]; + return; + } + + QUrl trackUri = store.getUniqueUri(":track_"); + store.add(Triple(trackUri, "a", store.expand("mo:Track"))); + store.add(Triple(trackUri, "dc:title", Node(Node::Literal, track))); + + Node sourceFileNode = store.addBlankNode(); + store.add(Triple(trackUri, "mo:available_as", sourceFileNode)); + store.add(Triple(sourceFileNode, "a", store.expand("mo:AudioFile"))); + + Node signalNode = store.addBlankNode(); + store.add(Triple(sourceFileNode, "mo:encodes", signalNode)); + store.add(Triple(signalNode, "a", store.expand("mo:Signal"))); + + QUrl timelineUri = store.getUniqueUri(":timeline_"); + Node sigIntervalNode = store.addBlankNode(); + store.add(Triple(signalNode, "mo:time", sigIntervalNode)); + store.add(Triple(sigIntervalNode, "a", store.expand("tl:Interval"))); + store.add(Triple(sigIntervalNode, "tl:onTimeLine", timelineUri)); + store.add(Triple(timelineUri, "a", store.expand("tl:Timeline"))); + + if (artist != "") { + if (!artistUriMap.contains(artist)) { + QUrl makerUri = store.getUniqueUri(":maker_"); + store.add(Triple(makerUri, "a", store.expand("mo:MusicArtist"))); + store.add(Triple(makerUri, "foaf:name", Node(Node::Literal, artist))); + artistUriMap[artist] = makerUri; + } + store.add(Triple(trackUri, "foaf:maker", artistUriMap[artist])); + + if (album != "") { + if (!artistAlbumUriMap[artist].contains(album)) { + QUrl albumUri = store.getUniqueUri(":record_"); + store.add(Triple(albumUri, "a", store.expand("mo:Record"))); + store.add(Triple(albumUri, "foaf:maker", artistUriMap[artist])); + store.add(Triple(albumUri, "mo:release_type", store.expand("mo:album"))); + store.add(Triple(albumUri, "dc:title", Node(Node::Literal, album))); + artistAlbumUriMap[artist][album] = albumUri; + } + store.add(Triple(artistAlbumUriMap[artist][album], "mo:track", trackUri)); + } + } + + artistAlbumTrackTimelineMap[artist][album][track] = timelineUri; + textFileTimelineMap[filename] = timelineUri; +} + +void +addBeat(Store &store, QString filename, float time, int number) +{ + static int beatcount = 1; + QString c = QString("%1").arg(beatcount++); + while (c.length() < 6) c = "0" + c; + + QUrl timelineUri = textFileTimelineMap[filename]; + + QUrl eventUri = store.expand(QString(":beat_%1").arg(c)); + store.add(Triple(eventUri, "a", store.expand("af:Beat"))); + + Node instantNode = store.addBlankNode(); + store.add(Triple(instantNode, "a", store.expand("tl:Instant"))); + store.add(Triple(instantNode, "tl:onTimeLine", timelineUri)); + + Node timeNode = Node::fromVariant(QTime().addMSecs(lrintf(time * 1000))); + store.add(Triple(instantNode, "tl:at", timeNode)); + store.add(Triple(eventUri, "event:time", instantNode)); + + store.add(Triple(eventUri, "rdfs:label", + Node(Node::Literal, QString("%1").arg(number)))); +} + +void +addKeySegment(Store &store, QString filename, float start, float end, QString label) +{ + static int segcount = 1; + QString c = QString("%1").arg(segcount++); + while (c.length() < 6) c = "0" + c; + + QUrl timelineUri = textFileTimelineMap[filename]; + + QUrl eventUri = store.expand(QString(":key_%1").arg(c)); + store.add(Triple(eventUri, "a", store.expand("af:KeySegment"))); + + Node intervalNode = store.addBlankNode(); + store.add(Triple(intervalNode, "a", store.expand("tl:Interval"))); + store.add(Triple(intervalNode, "tl:onTimeLine", timelineUri)); + + Node startNode = Node::fromVariant(QTime().addMSecs(lrintf(start * 1000))); + Node durationNode = Node::fromVariant(QTime().addMSecs(lrintf((end - start) * 1000))); + store.add(Triple(intervalNode, "tl:beginsAt", startNode)); + store.add(Triple(intervalNode, "tl:duration", durationNode)); + + store.add(Triple(eventUri, "event:time", intervalNode)); + store.add(Triple(eventUri, "rdfs:label", Node(Node::Literal, label))); +} + +void +addStructuralSegment(Store &store, QString filename, float start, float end, QString label) +{ + static int segcount = 1; + QString c = QString("%1").arg(segcount++); + while (c.length() < 6) c = "0" + c; + + QUrl timelineUri = textFileTimelineMap[filename]; + + QUrl eventUri = store.expand(QString(":segment_%1").arg(c)); + store.add(Triple(eventUri, "a", store.expand("af:StructuralSegment"))); + + Node intervalNode = store.addBlankNode(); + store.add(Triple(intervalNode, "a", store.expand("tl:Interval"))); + store.add(Triple(intervalNode, "tl:onTimeLine", timelineUri)); + + Node startNode = Node::fromVariant(QTime().addMSecs(lrintf(start * 1000))); + Node durationNode = Node::fromVariant(QTime().addMSecs(lrintf((end - start) * 1000))); + + store.add(Triple(intervalNode, "tl:beginsAt", startNode)); + store.add(Triple(intervalNode, "tl:duration", durationNode)); + + store.add(Triple(eventUri, "event:time", intervalNode)); + store.add(Triple(eventUri, "rdfs:label", Node(Node::Literal, label))); +} + +void +readFile(Store &store, QString filename) +{ + QFile f(filename); + + if (!f.open(QFile::ReadOnly | QFile::Text)) { + cerr << "Failed to open input file: " << filename.toStdString() << endl; + return; + } + + QTextStream stream(&f); + + QString currentFilename = filename; + + while (!stream.atEnd()) { + + QString line = stream.readLine(); + QStringList tokens = line.split(QRegExp("\\s+"), QString::SkipEmptyParts); + + if (tokens.empty()) { + cerr << "(empty line)" << endl; + continue; + } + + if (tokens[0][0].isDigit()) { + + checkTrack(store, currentFilename); + + if (tokens.size() == 2) { + addBeat(store, currentFilename, + tokens[0].toFloat(), tokens[1].toInt()); + } else if (tokens.size() == 3) { + if (tokens[2][0].isUpper()) { + addKeySegment(store, currentFilename, + tokens[0].toFloat(), tokens[1].toFloat(), + tokens[2]); + } else { + addStructuralSegment(store, currentFilename, + tokens[0].toFloat(), tokens[1].toFloat(), + tokens[2]); + } + } + + } else { + currentFilename = line; + } + } +} + +int +main(int argc, char **argv) +{ + if (argc < 2) usage(argv[0]); + + BasicStore store; + + store.addPrefix("dc", "http://purl.org/dc/elements/1.1/"); + store.addPrefix("mo", "http://purl.org/ontology/mo/"); + store.addPrefix("af", "http://purl.org/ontology/af/"); + store.addPrefix("foaf", "http://xmlns.com/foaf/0.1/"); + store.addPrefix("event", "http://purl.org/NET/c4dm/event.owl#"); + store.addPrefix("rdfs", "http://www.w3.org/2000/01/rdf-schema#"); + store.addPrefix("tl", "http://purl.org/NET/c4dm/timeline.owl#"); + store.addPrefix("vamp", "http://purl.org/ontology/vamp/"); + + for (int i = 1; i < argc; ++i) { + cerr << "reading file: " << argv[i] << endl; + readFile(store, argv[i]); + } + + cerr << "done, saving..." << endl; + + store.save("annotations.ttl"); + + return 0; +} + Added: annotation-converter/converter.pro =================================================================== --- annotation-converter/converter.pro (rev 0) +++ annotation-converter/converter.pro 2009-10-13 16:22:42 UTC (rev 1654) @@ -0,0 +1,10 @@ + +TEMPLATE = app +CONFIG += warn_on +QT -= gui +TARGET = converter + +INCLUDEPATH += .. +LIBS += -L../dataquay -ldataquay -L/usr/local/lib -lrdf -lrasqal -lraptor + +SOURCES += converter.cpp This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-10-13 16:21:37
|
Revision: 1653 http://sv1.svn.sourceforge.net/sv1/?rev=1653&view=rev Author: cannam Date: 2009-10-13 16:21:29 +0000 (Tue, 13 Oct 2009) Log Message: ----------- * Add directory for annotation converter program Added Paths: ----------- annotation-converter/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-10-09 09:13:35
|
Revision: 1652 http://sv1.svn.sourceforge.net/sv1/?rev=1652&view=rev Author: cannam Date: 2009-10-09 09:13:21 +0000 (Fri, 09 Oct 2009) Log Message: ----------- * Add forgotten file! Oh no! Added Paths: ----------- sonic-annotator/trunk/tests/test-include.sh Added: sonic-annotator/trunk/tests/test-include.sh =================================================================== --- sonic-annotator/trunk/tests/test-include.sh (rev 0) +++ sonic-annotator/trunk/tests/test-include.sh 2009-10-09 09:13:21 UTC (rev 1652) @@ -0,0 +1,18 @@ + +fail() { + echo "Test failed: $1" + exit 1 +} + +csvcompare() { + # permit some fuzz in final few digits + a="$1" + b="$2" + perl -p -e 's/(\d+\.\d{6})\d+/$1/' "$a" > "${a}__" + perl -p -e 's/(\d+\.\d{6})\d+/$1/' "$b" > "${b}__" + cmp -s "${a}__" "${b}__" + rv=$? + rm "${a}__" "${b}__" + return $rv +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cr...@us...> - 2009-10-07 16:45:55
|
Revision: 1651 http://sv1.svn.sourceforge.net/sv1/?rev=1651&view=rev Author: crhodes Date: 2009-10-07 16:45:45 +0000 (Wed, 07 Oct 2009) Log Message: ----------- More changes related to strict/tolerant URL parsing: * when selecting an output file name for a given input filename: - parse the url in StrictMode; - also, use completeBaseName() rather than baseName() * when writing out a file:/// URL to the audio: - parse the url in StrictMode. Modified Paths: -------------- sonic-visualiser/trunk/rdf/RDFFeatureWriter.cpp sonic-visualiser/trunk/transform/FileFeatureWriter.cpp Modified: sonic-visualiser/trunk/rdf/RDFFeatureWriter.cpp =================================================================== --- sonic-visualiser/trunk/rdf/RDFFeatureWriter.cpp 2009-10-07 13:10:49 UTC (rev 1650) +++ sonic-visualiser/trunk/rdf/RDFFeatureWriter.cpp 2009-10-07 16:45:45 UTC (rev 1651) @@ -300,7 +300,7 @@ * Describe signal we're analysing (AudioFile, Signal, TimeLine, etc.) */ - QUrl url(trackId); + QUrl url(trackId, QUrl::StrictMode); QString scheme = url.scheme().toLower(); bool local = (scheme == "" || scheme == "file" || scheme.length() == 1); Modified: sonic-visualiser/trunk/transform/FileFeatureWriter.cpp =================================================================== --- sonic-visualiser/trunk/transform/FileFeatureWriter.cpp 2009-10-07 13:10:49 UTC (rev 1650) +++ sonic-visualiser/trunk/transform/FileFeatureWriter.cpp 2009-10-07 16:45:45 UTC (rev 1651) @@ -167,7 +167,7 @@ if (m_stdout) return ""; - QUrl url(trackId); + QUrl url(trackId, QUrl::StrictMode); QString scheme = url.scheme().toLower(); bool local = (scheme == "" || scheme == "file" || scheme.length() == 1); @@ -176,7 +176,7 @@ if (infilename == "") { infilename = url.path(); } - basename = QFileInfo(infilename).baseName(); + basename = QFileInfo(infilename).completeBaseName(); if (scheme.length() == 1) { infilename = scheme + ":" + infilename; // DOS drive! } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-10-07 13:11:01
|
Revision: 1650 http://sv1.svn.sourceforge.net/sv1/?rev=1650&view=rev Author: cannam Date: 2009-10-07 13:10:49 +0000 (Wed, 07 Oct 2009) Log Message: ----------- * Convert strings to URLs in strict mode first; only try again in tolerant mode if this fails (and if the file is local) Modified Paths: -------------- sonic-visualiser/trunk/data/fileio/FileSource.cpp Modified: sonic-visualiser/trunk/data/fileio/FileSource.cpp =================================================================== --- sonic-visualiser/trunk/data/fileio/FileSource.cpp 2009-10-07 12:24:53 UTC (rev 1649) +++ sonic-visualiser/trunk/data/fileio/FileSource.cpp 2009-10-07 13:10:49 UTC (rev 1650) @@ -70,7 +70,7 @@ FileSource::FileSource(QString fileOrUrl, ProgressReporter *reporter, QString preferredContentType) : - m_url(fileOrUrl), + m_url(fileOrUrl, QUrl::StrictMode), m_ftp(0), m_http(0), m_localFile(0), @@ -96,6 +96,15 @@ init(); + if (!isRemote() && + !isAvailable()) { +#ifdef DEBUG_FILE_SOURCE + std::cerr << "FileSource::FileSource: Failed to open local file with URL \"" << m_url.toString().toStdString() << "; trying again with tolerant encoding" << std::endl; +#endif + m_url = QUrl(fileOrUrl, QUrl::TolerantMode); + init(); + } + if (isRemote() && (fileOrUrl.contains('%') || fileOrUrl.contains("--"))) { // for IDNA @@ -263,12 +272,12 @@ m_lastStatus = 200; if (!QFileInfo(m_localFilename).exists()) { -#ifdef DEBUG_FILE_SOURCE - std::cerr << "FileSource::init: Local file of this name does not exist, trying URL as a literal filename" << std::endl; -#endif if (literal) { m_lastStatus = 404; } else { +#ifdef DEBUG_FILE_SOURCE + std::cerr << "FileSource::init: Local file of this name does not exist, trying URL as a literal filename" << std::endl; +#endif // Again, QUrl may have been mistreating us -- // e.g. dropping a part that looks like query data m_localFilename = m_url.toString(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-10-07 12:25:01
|
Revision: 1649 http://sv1.svn.sourceforge.net/sv1/?rev=1649&view=rev Author: cannam Date: 2009-10-07 12:24:53 +0000 (Wed, 07 Oct 2009) Log Message: ----------- * remove unintended extra sv.prf file Removed Paths: ------------- sonic-annotator/trunk/sv.prf Deleted: sonic-annotator/trunk/sv.prf =================================================================== --- sonic-annotator/trunk/sv.prf 2009-10-06 14:06:09 UTC (rev 1648) +++ sonic-annotator/trunk/sv.prf 2009-10-07 12:24:53 UTC (rev 1649) @@ -1,173 +0,0 @@ - -### -### BEGIN CONFIGURABLE STUFF -### - -CONFIG += release - - -# Put your favourite optimization flags here. -# -# Don't use -ffast-math -- it does make things faster, but it -# prevents isnan and isinf from working, and we need those. -# -# SV benefits a bit from SSE, but not from SSE2 (it doesn't do -# very much in double precision). -# -# Always define NDEBUG and NO_TIMING for release builds. -# -QMAKE_CXXFLAGS_RELEASE += -DNDEBUG -DNO_TIMING -O3 -#linux-g++:QMAKE_CXXFLAGS_RELEASE += -march=pentium3 -msse -mmmx -ftree-vectorize -fomit-frame-pointer - -# To do a static build with gcc on Linux -# -#linux-g++:LIBS += -Wl,-Bstatic -#linux-g++:DEFINES += BUILD_STATIC - - -LIBPATH += /usr/local/lib -INCLUDEPATH += /usr/local/include - -DEFINES += NO_SV_GUI # avoid inclusion of widgets/ in transform library (bad!) - - -# These are testable on platforms with pkg-config. If you don't have -# pkg-config, edit the "If you don't have pkg-config" block below (see -# comments). -# -PKGCONFIG_PACKAGES = vamp vamp-hostsdk oggz fishsound mad id3tag fftw3 fftw3f sndfile samplerate lrdf redland rasqal raptor - - -# No pkg-config test for QuickTime. This library is optional, for -# audio file import. Note that if you compile in support for either -# or both of libmad and libsndfile as well as for QuickTime, libmad -# and libsndfile will be used in preference to QuickTime where -# applicable. For licensing reasons you may not redistribute binaries -# of Sonic Visualiser built with QuickTime support, except for -# platforms which include QuickTime as a standard part of the platform -# (i.e. OS/X). -# -#DEFINES += HAVE_QUICKTIME -#LIBS += -framework QuickTime - - -!system(pkg-config --atleast-pkgconfig-version=0) { - - # If you don't have pkg-config, or want to overrule it, comment - # out (or install) any of the following that you lack. If you - # have pkg-config, you should be able to ignore all this provided - # the right symbols are defined in PKGCONFIG_PACKAGES above. - # - DEFINES += HAVE_OGGZ # Optional -- to import .ogg files - DEFINES += HAVE_FISHSOUND # Optional -- to import .ogg files - DEFINES += HAVE_MAD # Optional -- to import .mp3 files - DEFINES += HAVE_ID3TAG # Optional -- to import .mp3 file tags - DEFINES += HAVE_FFTW3F # Optional -- but SV will be slower without it - DEFINES += HAVE_FFTW3 # Optional -- used by Rubber Band - # - LIBS += -loggz -lfishsound - LIBS += -lmad -lid3tag - LIBS += -lfftw3f - LIBS += -lfftw3 - - # These ones are mandatory. - # If you don't have them, you'll have to find them. - # - DEFINES += HAVE_VAMP # Required -- for analysis plugins - DEFINES += HAVE_VAMP_HOSTSDK # Required -- for analysis plugins - DEFINES += HAVE_SNDFILE # Required -- to import and export .wav files - DEFINES += HAVE_SAMPLERATE # Required -- for resampling - DEFINES += HAVE_RASQAL # Required -- for RDF - DEFINES += HAVE_REDLAND # Required -- for RDF - # - LIBS += -lvamp-hostsdk -lsndfile -lrdf -lrasqal -lraptor -lsamplerate - -} - -### -### END CONFIGURABLE STUFF -### - -system(pkg-config --atleast-pkgconfig-version=0) { - - # If you have pkg-config, this block should locate all packages - # for you provided they have .pc files and are listed in - # PKGCONFIG_PACKAGES. - # - for(PKG, PKGCONFIG_PACKAGES) { - contains(SV_UNIT_PACKAGES, $$PKG) { - system(pkg-config --exists $$PKG) { - VERSION = $$system(pkg-config --modversion $$PKG) - PACKAGE_SYMBOL = $$system(echo $$PKG | tr '[a-z-]' '[A-Z_]' | tr '.' '_') - VERSION_SYMBOL = $$PACKAGE_SYMBOL'_VERSION' - DEFINES += HAVE_$$PACKAGE_SYMBOL - QMAKE_CXXFLAGS += -D"'"$$VERSION_SYMBOL='"'$$VERSION'"'"'" - QMAKE_CXXFLAGS += $$system(pkg-config --cflags $$PKG) - LIBS += $$system(pkg-config --libs $$PKG) - message("Using pkg-config package $$PKG with version $$VERSION") - } else { - message("WARNING: Failed to find pkg-config package $$PKG") - } - } - } -} - -contains(SV_UNIT_PACKAGES, oggz) { - contains(DEFINES, HAVE_OGGZ) { - contains(DEFINES, HAVE_FISHSOUND) { - message("Including .ogg file import") - } else { - message("WARNING: .ogg file import will not be included") - } - } else { - message("WARNING: .ogg file import will not be included") - } -} - -contains(SV_UNIT_PACKAGES, mad) { - contains(DEFINES, HAVE_MAD) { - message("Including .mp3 file import") - } else { - message("WARNING: .mp3 file import will not be included") - } -} - -contains(SV_UNIT_PACKAGES, id3tag) { - contains(DEFINES, HAVE_ID3TAG) { - message("Including .mp3 file tag support") - } else { - message("WARNING: .mp3 file tag support will not be included") - } -} - -contains(SV_UNIT_PACKAGES, fftw3f) { - contains(DEFINES, HAVE_FFTW3F) { - message("Using FFTW3f") - } else { - message("WARNING: FFTW3f not available, using slower FFT implementation") - } -} - -contains(SV_UNIT_PACKAGES, vamp):!contains(DEFINES, HAVE_VAMP):error("Vamp plugin API required") -contains(SV_UNIT_PACKAGES, vamp-hostsdk):!contains(DEFINES, HAVE_VAMP_HOSTSDK):error("Vamp plugin host SDK required") -contains(SV_UNIT_PACKAGES, sndfile):!contains(DEFINES, HAVE_SNDFILE):error("sndfile library required") -contains(SV_UNIT_PACKAGES, samplerate):!contains(DEFINES, HAVE_SAMPLERATE):error("libsamplerate required") -contains(SV_UNIT_PACKAGES, rasqal):!contains(DEFINES, HAVE_RASQAL):error("Rasqal RDF query library required") -contains(SV_UNIT_PACKAGES, redland):!contains(DEFINES, HAVE_REDLAND):error("Redland RDF datastore required") - -VERSION_CFLAGS += -D"'"SVNREV='"'$$system(svnversion -n .)'"'"'" - -QMAKE_CXXFLAGS_DEBUG += -DBUILD_DEBUG $$VERSION_CFLAGS -QMAKE_CXXFLAGS_RELEASE += -DBUILD_RELEASE $$VERSION_CFLAGS - -LIBS -= -lpthread - -linux-g++ { - contains(DEFINES, BUILD_STATIC) { - LIBS += -lFLAC -lxml2 - } -} - -# Restore dynamic linkage, in case we went static earlier -linux-g++:LIBS += -Wl,-Bdynamic -lpthread -ldl - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-10-06 14:06:16
|
Revision: 1648 http://sv1.svn.sourceforge.net/sv1/?rev=1648&view=rev Author: cannam Date: 2009-10-06 14:06:09 +0000 (Tue, 06 Oct 2009) Log Message: ----------- * update latest version for notification purposes Modified Paths: -------------- website/latest-version.txt Modified: website/latest-version.txt =================================================================== --- website/latest-version.txt 2009-10-06 14:00:11 UTC (rev 1647) +++ website/latest-version.txt 2009-10-06 14:06:09 UTC (rev 1648) @@ -1 +1 @@ -1.6 +1.7 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-10-06 14:00:24
|
Revision: 1647 http://sv1.svn.sourceforge.net/sv1/?rev=1647&view=rev Author: cannam Date: 2009-10-06 14:00:11 +0000 (Tue, 06 Oct 2009) Log Message: ----------- ... Modified Paths: -------------- website/download.html Modified: website/download.html =================================================================== --- website/download.html 2009-10-06 12:45:45 UTC (rev 1646) +++ website/download.html 2009-10-06 14:00:11 UTC (rev 1647) @@ -25,8 +25,8 @@ <h2 id="firstpara">Download Sonic Visualiser</h2> - <p>Sonic Visualiser is available ready-to-run for Linux, OS/X - and Windows.</p> + <p>Sonic Visualiser is available ready-to-run for Linux, OS/X, + Windows, and OpenSolaris.</p> <p>The current release is 1.7. Read the <a href="https://sourceforge.net/projects/sv1/files/sonic-visualiser/1.7/CHANGELOG/download">release notes</a>.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-10-06 12:45:53
|
Revision: 1646 http://sv1.svn.sourceforge.net/sv1/?rev=1646&view=rev Author: cannam Date: 2009-10-06 12:45:45 +0000 (Tue, 06 Oct 2009) Log Message: ----------- * update doc for 1.7 (though no actual changes yet) Modified Paths: -------------- website/documentation.html Added Paths: ----------- website/doc/reference/1.7/ Modified: website/documentation.html =================================================================== --- website/documentation.html 2009-10-06 12:43:03 UTC (rev 1645) +++ website/documentation.html 2009-10-06 12:45:45 UTC (rev 1646) @@ -27,7 +27,14 @@ <h3>Reference Manual</h3> <ul> - <li><a href="doc/reference/1.6/en/index.html">Reference manual for Sonic Visualiser 1.6</a>.<br>Also still available <a href="doc/reference/1.5/en/index.html">for 1.5</a>, <a href="doc/reference/1.3/en/index.html">for 1.3</a>, <a href="doc/reference/1.2/en/index.html">for 1.2</a>, and <a href="doc/reference/1.0/en/index.html">for 1.0</a>.</li> + <li><a href="doc/reference/1.7/en/index.html">Reference manual for Sonic Visualiser 1.7</a>. + <br>Also still available + <a href="doc/reference/1.6/en/index.html">for 1.6</a>, + <a href="doc/reference/1.5/en/index.html">for 1.5</a>, + <a href="doc/reference/1.4/en/index.html">for 1.4</a>, + <a href="doc/reference/1.3/en/index.html">for 1.3</a>, + <a href="doc/reference/1.2/en/index.html">for 1.2</a>, and + <a href="doc/reference/1.0/en/index.html">for 1.0</a>.</li> </ul> <h3>Tutorials</h3> <ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-10-06 12:43:12
|
Revision: 1645 http://sv1.svn.sourceforge.net/sv1/?rev=1645&view=rev Author: cannam Date: 2009-10-06 12:43:03 +0000 (Tue, 06 Oct 2009) Log Message: ----------- * update for 1.7 Modified Paths: -------------- website/download.html website/index.html Added Paths: ----------- website/images/osol.png Modified: website/download.html =================================================================== --- website/download.html 2009-10-05 14:22:22 UTC (rev 1644) +++ website/download.html 2009-10-06 12:43:03 UTC (rev 1645) @@ -28,77 +28,48 @@ <p>Sonic Visualiser is available ready-to-run for Linux, OS/X and Windows.</p> - <p>The current release is 1.6. Read the <a href="https://sourceforge.net/project/shownotes.php?group_id=162924&release_id=695075">release notes</a>.</p> + <p>The current release is 1.7. Read the <a href="https://sourceforge.net/projects/sv1/files/sonic-visualiser/1.7/CHANGELOG/download">release notes</a>.</p> <table align=center border=1 cellpadding=5 style="clear:right"> <tr><th> </th> <th>Linux</th> <th>OS/X</th> <th>Windows</th> - <th>Source code</th> + <th>Solaris</th> </tr> <tr> - <td align=center>Version<br><big><b>1.6</b></big></td> + <td align=center>Version<br><big><b>1.7</b></big></td> <td align=center><br><a - href="http://downloads.sourceforge.net/sv1/sonic-visualiser_1.6cc-1_i386.deb"><img src="images/linux.png" valign=middle style="padding-right:8px" border=0>Download (32-bit)</a><br><a - href="http://downloads.sourceforge.net/sv1/sonic-visualiser_1.6cc-1_amd64.deb"><img src="images/linux.png" valign=middle style="padding-right:8px" border=0>Download (64-bit)</a><br><br> + href="http://downloads.sourceforge.net/sv1/sonic-visualiser_1.7cc-1_i386.deb"><img src="images/linux.png" valign=middle style="padding-right:8px" border=0>32-bit</a> or <a + href="http://downloads.sourceforge.net/sv1/sonic-visualiser_1.7cc-1_amd64.deb">64-bit</a><br><br> <span style="font-size: 0.9em">Package for Ubuntu 8.10 and 9.04</span><br><br> - <table border=0 style="font-size: 0.9em"><tr> - <td valign=top><b>Formats</b></td> - <td valign=top>WAV/AIFF, Ogg, MP3</td> - </tr><tr> - <td valign=top><b>Playback</b> </td> - <td valign=top>PulseAudio, JACK, ALSA</td> - </tr><tr> - <td valign=top><b>Plugins</b></td> - <td valign=top>Vamp, LADSPA, DSSI</td> - </tr><tr> - <td valign=top><b>Control</b></td> - <td valign=top>OSC</td> - </tr></table> </td> <td align=center><br><a - href="http://downloads.sourceforge.net/sv1/sonic-visualiser-1.6-osx-universal.dmg"><img src="images/mac.png" valign=middle style="padding-right:8px" border=0>Download</a><br><br> - <span style="font-size: 0.9em">Universal binary .app bundle<br>For OS/X 10.4 or newer</span><br><br> - <table border=0 style="font-size: 0.9em"><tr> - <td valign=top><b>Formats</b></td> - <td valign=top>WAV/AIFF, Ogg, MP3, AAC (non-DRM)</td> - </tr><tr> - <td valign=top><b>Playback</b> </td> - <td valign=top>CoreAudio</td> - </tr><tr> - <td valign=top><b>Plugins</b></td> - <td valign=top>Vamp, LADSPA, DSSI</td> - </tr><tr> - <td valign=top><b>Control</b></td> - <td valign=top></td> - </tr></table> + href="http://downloads.sourceforge.net/sv1/Sonic%20Visualiser%201.7.dmg"><img src="images/mac.png" valign=middle style="padding-right:8px" border=0>Download</a><br><br> + <span style="font-size: 0.9em">Universal for 10.4 or newer</span><br><br> </td> <td align=center><br><a - href="http://downloads.sourceforge.net/sv1/sonic-visualiser-1.6-win32.zip"><img src="images/win.png" valign=middle style="padding-right:8px" border=0>Download</a><br><br> + href="http://downloads.sourceforge.net/sv1/sonic-visualiser-1.7-win32.zip"><img src="images/win.png" valign=middle style="padding-right:8px" border=0>Download</a><br><br> <span style="font-size: 0.9em">32-bit Windows executable<br> </span><br><br> - <table border=0 style="font-size: 0.9em"><tr> - <td valign=top><b>Formats</b></td> - <td valign=top>WAV/AIFF, Ogg, MP3</td> - </tr><tr> - <td valign=top><b>Playback</b> </td> - <td valign=top>WinMME</td> - </tr><tr> - <td valign=top><b>Plugins</b></td> - <td valign=top>Vamp, LADSPA, DSSI</td> - </tr><tr> - <td valign=top><b>Control</b></td> - <td valign=top></td> - </tr></table> </td> - <td align=center valign=top><br> <a href="http://downloads.sourceforge.net/sv1/sonic-visualiser-1.6.tar.bz2"><img src="images/source.png" valign=middle style="padding-right:8px" border=0>Download</a> </td> + <td align=center><br><a + href="http://downloads.sourceforge.net/sv1/sonic-visualiser-1.7-i386-osol.zip"><img src="images/osol.png" valign=middle style="padding-right:8px" border=0>Download</a><br><br> + <span style="font-size: 0.9em">32-bit Solaris or OpenSolaris<br> </span><br><br> + </td> + </tr><tr> + <td align=center><b>Source code</b></td> +<!-- <td colspan=4 align=center valign=top><br> <a href="http://downloads.sourceforge.net/sv1/sonic-visualiser-1.7.tar.bz2"><img src="images/source.png" valign=middle style="padding-right:8px" border=0>Download</a> </td> --> + <td colspan=4 align=center valign=middle><a href="http://downloads.sourceforge.net/sv1/sonic-visualiser-1.7.tar.bz2"><img src="images/source.png" valign=middle style="padding-right:8px" border=0>Download</a></td> + + + </tr><tr> <td align=center>Older versions</td> <td colspan=4 align=center>See the SourceForge <a href="https://sourceforge.net/project/showfiles.php?group_id=162924">downloads page</a>.</td> </tr> Added: website/images/osol.png =================================================================== (Binary files differ) Property changes on: website/images/osol.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: website/index.html =================================================================== --- website/index.html 2009-10-05 14:22:22 UTC (rev 1644) +++ website/index.html 2009-10-06 12:43:03 UTC (rev 1645) @@ -28,7 +28,7 @@ <a href="screenshots.html"><img src="images/sv2-thumb.png" width=336 height=285 alt="Sonic Visualiser screen shot" border=0 style="float:left;padding-top:2em;padding-bottom:3em;padding-right:3em"/></a> - <p><b>6th July 2009:</b> Sonic Visualiser 1.6 has been released. Get it <a href="download.html">here</a>!</p> + <p><b>5th October 2009:</b> Sonic Visualiser 1.7 has been released. Get it <a href="download.html">here</a>!</p> <p>The aim of Sonic Visualiser is to be the first program you reach for when want to study a musical recording rather than This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-10-05 14:22:33
|
Revision: 1644 http://sv1.svn.sourceforge.net/sv1/?rev=1644&view=rev Author: cannam Date: 2009-10-05 14:22:22 +0000 (Mon, 05 Oct 2009) Log Message: ----------- * Tag for 1.7 Added Paths: ----------- sonic-visualiser/tags/sv-v1.7/ Property changes on: sonic-visualiser/tags/sv-v1.7 ___________________________________________________________________ Added: svn:mergeinfo + /sonic-visualiser/branches/one-fftdataserver-per-fftmodel:1406-1415 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-10-02 15:39:37
|
Revision: 1643 http://sv1.svn.sourceforge.net/sv1/?rev=1643&view=rev Author: cannam Date: 2009-10-02 15:34:44 +0000 (Fri, 02 Oct 2009) Log Message: ----------- * Update change log for 1.7 Modified Paths: -------------- sonic-visualiser/trunk/CHANGELOG Modified: sonic-visualiser/trunk/CHANGELOG =================================================================== --- sonic-visualiser/trunk/CHANGELOG 2009-10-02 13:56:10 UTC (rev 1642) +++ sonic-visualiser/trunk/CHANGELOG 2009-10-02 15:34:44 UTC (rev 1643) @@ -1,4 +1,26 @@ +Changes in Sonic Visualiser 1.7 since the previous release 1.6: + + - A new "Insert Item At Selection" function on the Edit menu + can be used to create Note and Region layer items whose time + extents correspond to the current selection(s) + + - Interactively editing points in the Note and Region layers + now works much more smoothly + + - SV can now import MIDI files that use SMPTE timecode for event + timing (importing MIDI files using with the more common + timebase-based timing was already supported) + + - Time values throughout the display may optionally be shown in + seconds and frames at various frame rates + + - A crash on exit in Windows has been fixed + + - A very unobtrusive user survey is now included + + - Various other bug fixes. + Changes in Sonic Visualiser 1.6 since the previous release 1.5: - The Colour 3D Plot layer now supports logarithmic vertical This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-10-02 13:56:17
|
Revision: 1642 http://sv1.svn.sourceforge.net/sv1/?rev=1642&view=rev Author: cannam Date: 2009-10-02 13:56:10 +0000 (Fri, 02 Oct 2009) Log Message: ----------- * Big improvements to editing behaviour in note and region models Modified Paths: -------------- sonic-visualiser/trunk/framework/MainWindowBase.cpp sonic-visualiser/trunk/layer/NoteLayer.cpp sonic-visualiser/trunk/layer/NoteLayer.h sonic-visualiser/trunk/layer/RegionLayer.cpp sonic-visualiser/trunk/layer/RegionLayer.h sonic-visualiser/trunk/view/Pane.cpp Modified: sonic-visualiser/trunk/framework/MainWindowBase.cpp =================================================================== --- sonic-visualiser/trunk/framework/MainWindowBase.cpp 2009-09-29 10:34:57 UTC (rev 1641) +++ sonic-visualiser/trunk/framework/MainWindowBase.cpp 2009-10-02 13:56:10 UTC (rev 1642) @@ -896,7 +896,7 @@ RegionModel *rm = dynamic_cast<RegionModel *>(layer->getModel()); if (rm) { RegionModel::Point point(alignedStart, - rm->getValueMinimum(), + rm->getValueMaximum() + 1, alignedDuration, ""); RegionModel::EditCommand *command = Modified: sonic-visualiser/trunk/layer/NoteLayer.cpp =================================================================== --- sonic-visualiser/trunk/layer/NoteLayer.cpp 2009-09-29 10:34:57 UTC (rev 1641) +++ sonic-visualiser/trunk/layer/NoteLayer.cpp 2009-10-02 13:56:10 UTC (rev 1642) @@ -36,6 +36,7 @@ #include <iostream> #include <cmath> +#include <utility> NoteLayer::NoteLayer() : SingleColourLayer(), @@ -414,7 +415,7 @@ NoteModel::PointList onPoints = m_model->getPoints(frame); if (onPoints.empty()) return false; - std::cerr << "frame " << frame << ": " << onPoints.size() << " candidate points" << std::endl; +// std::cerr << "frame " << frame << ": " << onPoints.size() << " candidate points" << std::endl; int nearestDistance = -1; @@ -731,12 +732,12 @@ if (max == min) max = min + 1.0; QPoint localPos; - long illuminateFrame = -1; + NoteModel::Point illuminatePoint(0); + bool shouldIlluminate = false; if (v->shouldIlluminateLocalFeatures(this, localPos)) { - NoteModel::PointList localPoints = - getLocalPoints(v, localPos.x()); - if (!localPoints.empty()) illuminateFrame = localPoints.begin()->frame; + shouldIlluminate = getPointToDrag(v, localPos.x(), localPos.y(), + illuminatePoint); } paint.save(); @@ -761,18 +762,30 @@ paint.setPen(getBaseQColor()); paint.setBrush(brushColour); - if (illuminateFrame == p.frame) { - if (localPos.y() >= y - h && localPos.y() < y) { - paint.setPen(v->getForeground()); - paint.setBrush(v->getForeground()); - } + if (shouldIlluminate && + // "illuminatePoint == p" + !NoteModel::Point::Comparator()(illuminatePoint, p) && + !NoteModel::Point::Comparator()(p, illuminatePoint)) { + + paint.setPen(v->getForeground()); + paint.setBrush(v->getForeground()); + + QString vlabel = QString("%1%2").arg(p.value).arg(m_model->getScaleUnits()); + v->drawVisibleText(paint, + x - paint.fontMetrics().width(vlabel) - 2, + y + paint.fontMetrics().height()/2 + - paint.fontMetrics().descent(), + vlabel, View::OutlinedText); + + QString hlabel = RealTime::frame2RealTime + (p.frame, m_model->getSampleRate()).toText(true).c_str(); + v->drawVisibleText(paint, + x, + y - h/2 - paint.fontMetrics().descent() - 2, + hlabel, View::OutlinedText); } paint.drawRect(x, y - h/2, w, h); - -/// if (p.label != "") { -/// paint.drawText(x + 5, y - paint.fontMetrics().height() + paint.fontMetrics().ascent(), p.label); -/// } } paint.restore(); @@ -846,11 +859,6 @@ { if (!m_model) return; -// NoteModel::PointList points = getLocalPoints(v, e->x()); -// if (points.empty()) return; - -// m_editingPoint = *points.begin(); - if (!getPointToDrag(v, e->x(), e->y(), m_editingPoint)) return; if (m_editingCommand) { @@ -873,13 +881,6 @@ m_editing = false; -/* - NoteModel::PointList points = getLocalPoints(v, e->x()); - if (points.empty()) return; - if (points.begin()->frame != m_editingPoint.frame || - points.begin()->value != m_editingPoint.value) return; -*/ - NoteModel::Point p(0); if (!getPointToDrag(v, e->x(), e->y(), p)) return; if (p.frame != m_editingPoint.frame || p.value != m_editingPoint.value) return; @@ -900,22 +901,20 @@ if (!m_model) return; -/* - NoteModel::PointList points = getLocalPoints(v, e->x()); - if (points.empty()) return; - - m_editingPoint = *points.begin(); -*/ - if (!getPointToDrag(v, e->x(), e->y(), m_editingPoint)) return; m_originalPoint = m_editingPoint; + m_dragPointX = v->getXForFrame(m_editingPoint.frame); + m_dragPointY = getYForValue(v, m_editingPoint.value); + if (m_editingCommand) { finish(m_editingCommand); m_editingCommand = 0; } m_editing = true; + m_dragStartX = e->x(); + m_dragStartY = e->y(); } void @@ -925,11 +924,16 @@ if (!m_model || !m_editing) return; - long frame = v->getFrameForX(e->x()); + int xdist = e->x() - m_dragStartX; + int ydist = e->y() - m_dragStartY; + int newx = m_dragPointX + xdist; + int newy = m_dragPointY + ydist; + + long frame = v->getFrameForX(newx); if (frame < 0) frame = 0; frame = frame / m_model->getResolution() * m_model->getResolution(); - float value = getValueForY(v, e->y()); + float value = getValueForY(v, newy); if (!m_editingCommand) { m_editingCommand = new NoteModel::EditCommand(m_model, @@ -974,10 +978,6 @@ NoteLayer::editOpen(View *v, QMouseEvent *e) { if (!m_model) return false; -/* - NoteModel::PointList points = getLocalPoints(v, e->x()); - if (points.empty()) return false; -*/ NoteModel::Point note(0); if (!getPointToDrag(v, e->x(), e->y(), note)) return false; Modified: sonic-visualiser/trunk/layer/NoteLayer.h =================================================================== --- sonic-visualiser/trunk/layer/NoteLayer.h 2009-09-29 10:34:57 UTC (rev 1641) +++ sonic-visualiser/trunk/layer/NoteLayer.h 2009-10-02 13:56:10 UTC (rev 1642) @@ -139,6 +139,10 @@ NoteModel *m_model; bool m_editing; + int m_dragPointX; + int m_dragPointY; + int m_dragStartX; + int m_dragStartY; NoteModel::Point m_originalPoint; NoteModel::Point m_editingPoint; NoteModel::EditCommand *m_editingCommand; Modified: sonic-visualiser/trunk/layer/RegionLayer.cpp =================================================================== --- sonic-visualiser/trunk/layer/RegionLayer.cpp 2009-09-29 10:34:57 UTC (rev 1641) +++ sonic-visualiser/trunk/layer/RegionLayer.cpp 2009-10-02 13:56:10 UTC (rev 1642) @@ -236,24 +236,23 @@ RegionLayer::recalcSpacing() { m_spacingMap.clear(); + m_distributionMap.clear(); if (!m_model) return; - std::cerr << "RegionLayer::recalcSpacing" << std::endl; +// std::cerr << "RegionLayer::recalcSpacing" << std::endl; - std::set<float> values; - for (RegionModel::PointList::const_iterator i = m_model->getPoints().begin(); i != m_model->getPoints().end(); ++i) { - values.insert(i->value); - std::cerr << "RegionLayer::recalcSpacing: value found: " << i->value << std::endl; + m_distributionMap[i->value]++; +// std::cerr << "RegionLayer::recalcSpacing: value found: " << i->value << " (now have " << m_distributionMap[i->value] << " of this value)" << std::endl; } int n = 0; - for (std::set<float>::const_iterator i = values.begin(); - i != values.end(); ++i) { - m_spacingMap[*i] = n++; - std::cerr << "RegionLayer::recalcSpacing: " << *i << " -> " << m_spacingMap[*i] << std::endl; + for (SpacingMap::const_iterator i = m_distributionMap.begin(); + i != m_distributionMap.end(); ++i) { + m_spacingMap[i->first] = n++; +// std::cerr << "RegionLayer::recalcSpacing: " << i->first << " -> " << m_spacingMap[i->first] << std::endl; } } @@ -575,8 +574,8 @@ // we return an inexact result here (float rather than int) int h = v->height(); int n = m_spacingMap.size(); - // from y = h - ((h * i) / n) + (h / (2 * n)) as above - float vh = ((h + (h / float(2 * n)) - y) * n) / h; + // from y = h - ((h * i) / n) + (h / (2 * n)) as above (vh taking place of i) + float vh = float(2*h*n - h - 2*n*y) / float(2*h); return vh; } @@ -596,7 +595,7 @@ int y = spacingIndexToY(v, i->second); - std::cerr << "RegionLayer::getYForValue: value " << val << " -> i->second " << i->second << " -> y " << y << std::endl; +// std::cerr << "RegionLayer::getYForValue: value " << val << " -> i->second " << i->second << " -> y " << y << std::endl; return y; @@ -616,7 +615,7 @@ } float -RegionLayer::getValueForY(View *v, int y) const +RegionLayer::getValueForY(View *v, int y, int avoid) const { float min = 0.0, max = 0.0; bool logarithmic = false; @@ -649,7 +648,7 @@ int dist = iy - y; int gap = h / n; // between region lines - std::cerr << "getValueForY: y = " << y << ", n = " << n << ", vh = " << vh << ", iy = " << iy << ", dist = " << dist << ", gap = " << gap << std::endl; +// std::cerr << "getValueForY: y = " << y << ", vh = " << vh << ", ivh = " << ivh << " of " << n << ", iy = " << iy << ", dist = " << dist << ", gap = " << gap << std::endl; SpacingMap::const_iterator i = m_spacingMap.begin(); while (i != m_spacingMap.end()) { @@ -658,34 +657,42 @@ } if (i == m_spacingMap.end()) i = m_spacingMap.begin(); +// std::cerr << "nearest existing value = " << i->first << " at " << iy << std::endl; + float val = 0; - if (dist > -gap/3 && dist < gap/3) { - // snap - val = i->first; - std::cerr << "snapped to " << val << std::endl; - } else if (dist < 0) { +// std::cerr << "note: avoid = " << avoid << ", i->second = " << i->second << std::endl; + + if (dist < -gap/3 && + ((avoid == -1) || + (avoid != i->second && avoid != i->second - 1))) { // bisect gap to prior if (i == m_spacingMap.begin()) { val = i->first - 1.f; - std::cerr << "extended down to " << val << std::endl; +// std::cerr << "extended down to " << val << std::endl; } else { SpacingMap::const_iterator j = i; --j; val = (i->first + j->first) / 2; - std::cerr << "bisected down to " << val << std::endl; +// std::cerr << "bisected down to " << val << std::endl; } - } else { + } else if (dist > gap/3 && + ((avoid == -1) || + (avoid != i->second && avoid != i->second + 1))) { // bisect gap to following SpacingMap::const_iterator j = i; ++j; if (j == m_spacingMap.end()) { val = i->first + 1.f; - std::cerr << "extended up to " << val << std::endl; +// std::cerr << "extended up to " << val << std::endl; } else { val = (i->first + j->first) / 2; - std::cerr << "bisected up to " << val << std::endl; +// std::cerr << "bisected up to " << val << std::endl; } + } else { + // snap + val = i->first; +// std::cerr << "snapped to " << val << std::endl; } return val; @@ -764,12 +771,12 @@ if (max == min) max = min + 1.0; QPoint localPos; - long illuminateFrame = -1; + RegionModel::Point illuminatePoint(0); + bool shouldIlluminate = false; if (v->shouldIlluminateLocalFeatures(this, localPos)) { - RegionModel::PointList localPoints = - getLocalPoints(v, localPos.x()); - if (!localPoints.empty()) illuminateFrame = localPoints.begin()->frame; + shouldIlluminate = getPointToDrag(v, localPos.x(), localPos.y(), + illuminatePoint); } paint.save(); @@ -781,11 +788,6 @@ //!!! if it does have distinct values, we should still ensure y //!!! coord is never completely flat on the top or bottom - int textY = 0; - if (m_plotStyle == PlotSegmentation) { - textY = v->getTextLabelHeight(this, paint); - } - int fontHeight = paint.fontMetrics().height(); int fontAscent = paint.fontMetrics().ascent(); @@ -809,13 +811,6 @@ if (nx < ex) ex = nx; } - if (m_plotStyle != PlotSegmentation) { - textY = y - fontHeight + fontAscent; - if (textY < fontAscent + 1) { - textY = fontAscent + 1; - } - } - if (m_model->getValueQuantization() != 0.0) { h = y - getYForValue(v, p.value + m_model->getValueQuantization()); if (h < 3) h = 3; @@ -831,37 +826,76 @@ paint.setBrush(brushColour); } + bool illuminated = false; + if (m_plotStyle == PlotSegmentation) { if (ex <= x) continue; - if (illuminateFrame != p.frame && - (ex < x + 5 || x >= v->width() - 1)) { - paint.setPen(Qt::NoPen); - } + if (!shouldIlluminate || + // "illuminatePoint != p" + RegionModel::Point::Comparator()(illuminatePoint, p) || + RegionModel::Point::Comparator()(p, illuminatePoint)) { +// if (illuminateFrame != p.frame && +// (ex < x + 5 || x >= v->width() - 1)) { + paint.setPen(Qt::NoPen); + } + paint.drawRect(x, -1, ex - x, v->height() + 1); } else { - if (illuminateFrame == p.frame) { - if (localPos.y() >= y - h && localPos.y() < y) { - paint.setPen(v->getForeground()); - paint.setBrush(v->getForeground()); - } + if (shouldIlluminate && + // "illuminatePoint == p" + !RegionModel::Point::Comparator()(illuminatePoint, p) && + !RegionModel::Point::Comparator()(p, illuminatePoint)) { + + paint.setPen(v->getForeground()); + paint.setBrush(v->getForeground()); + + QString vlabel = QString("%1%2").arg(p.value).arg(m_model->getScaleUnits()); + v->drawVisibleText(paint, + x - paint.fontMetrics().width(vlabel) - 2, + y + paint.fontMetrics().height()/2 + - paint.fontMetrics().descent(), + vlabel, View::OutlinedText); + + QString hlabel = RealTime::frame2RealTime + (p.frame, m_model->getSampleRate()).toText(true).c_str(); + v->drawVisibleText(paint, + x, + y - h/2 - paint.fontMetrics().descent() - 2, + hlabel, View::OutlinedText); + + illuminated = true; } - + paint.drawLine(x, y-1, x + w, y-1); paint.drawLine(x, y+1, x + w, y+1); paint.drawLine(x, y - h/2, x, y + h/2); paint.drawLine(x+w, y - h/2, x + w, y + h/2); } - QString label = p.label; - if (label == "") { - label = QString("[%1]").arg(p.value); + if (!illuminated) { + QString label = p.label; + if (label == "") { + label = QString("%1%2").arg(p.value).arg(m_model->getScaleUnits()); + } + + if (m_plotStyle != PlotSegmentation) { + v->drawVisibleText(paint, + x - paint.fontMetrics().width(label) - 2, + y + paint.fontMetrics().height()/2 + - paint.fontMetrics().descent(), + label, View::OutlinedText); + } else { + v->drawVisibleText(paint, + x + 5, + v->getTextLabelHeight(this, paint), + label, View::OutlinedText); + } } - v->drawVisibleText(paint, x + 5, textY, label, View::OutlinedText); } paint.restore(); @@ -870,8 +904,6 @@ void RegionLayer::drawStart(View *v, QMouseEvent *e) { -// std::cerr << "RegionLayer::drawStart(" << e->x() << "," << e->y() << ")" << std::endl; - if (!m_model) return; long frame = v->getFrameForX(e->x()); @@ -896,8 +928,6 @@ void RegionLayer::drawDrag(View *v, QMouseEvent *e) { -// std::cerr << "RegionLayer::drawDrag(" << e->x() << "," << e->y() << ")" << std::endl; - if (!m_model || !m_editing) return; long frame = v->getFrameForX(e->x()); @@ -922,13 +952,12 @@ m_editingPoint.duration = newDuration; m_editingCommand->addPoint(m_editingPoint); -// recalcSpacing(); + recalcSpacing(); } void RegionLayer::drawEnd(View *, QMouseEvent *) { -// std::cerr << "RegionLayer::drawEnd(" << e->x() << "," << e->y() << ")" << std::endl; if (!m_model || !m_editing) return; finish(m_editingCommand); m_editingCommand = 0; @@ -943,12 +972,7 @@ if (!m_model) return; if (!getPointToDrag(v, e->x(), e->y(), m_editingPoint)) return; -/* - RegionModel::PointList points = getLocalPoints(v, e->x()); - if (points.empty()) return; - m_editingPoint = *points.begin(); -*/ if (m_editingCommand) { finish(m_editingCommand); m_editingCommand = 0; @@ -969,12 +993,7 @@ if (!m_model || !m_editing) return; m_editing = false; -/* - RegionModel::PointList points = getLocalPoints(v, e->x()); - if (points.empty()) return; - if (points.begin()->frame != m_editingPoint.frame || - points.begin()->value != m_editingPoint.value) return; -*/ + RegionModel::Point p(0); if (!getPointToDrag(v, e->x(), e->y(), p)) return; if (p.frame != m_editingPoint.frame || p.value != m_editingPoint.value) return; @@ -993,22 +1012,15 @@ void RegionLayer::editStart(View *v, QMouseEvent *e) { - std::cerr << "RegionLayer::editStart(" << e->x() << "," << e->y() << ")" << std::endl; - if (!m_model) return; -// OrderedPointList opoints = getNearbyPoints(v, e->x(), e->y()); -// RegionLayer: - -// RegionModel::PointList points = getLocalPoints(v, e->x()); -// if (points.empty()) return; - -// m_editingPoint = *points.begin(); - if (!getPointToDrag(v, e->x(), e->y(), m_editingPoint)) { return; } + m_dragPointX = v->getXForFrame(m_editingPoint.frame); + m_dragPointY = getYForValue(v, m_editingPoint.value); + m_originalPoint = m_editingPoint; if (m_editingCommand) { @@ -1017,36 +1029,39 @@ } m_editing = true; - m_dragYOrigin = e->y(); - m_dragYRebase = e->y(); + m_dragStartX = e->x(); + m_dragStartY = e->y(); recalcSpacing(); } void RegionLayer::editDrag(View *v, QMouseEvent *e) { - std::cerr << "RegionLayer::editDrag(" << e->x() << "," << e->y() << ")" << std::endl; - if (!m_model || !m_editing) return; - long frame = v->getFrameForX(e->x()); + int xdist = e->x() - m_dragStartX; + int ydist = e->y() - m_dragStartY; + int newx = m_dragPointX + xdist; + int newy = m_dragPointY + ydist; + + long frame = v->getFrameForX(newx); if (frame < 0) frame = 0; frame = frame / m_model->getResolution() * m_model->getResolution(); - int activeY = e->y() + (m_dragYRebase - m_dragYOrigin); - float value = getValueForY(v, activeY); + // Do not bisect between two values, if one of those values is + // that of the point we're actually moving ... + int avoid = m_spacingMap[m_editingPoint.value]; + // ... unless there are other points with the same value + if (m_distributionMap[m_editingPoint.value] > 1) avoid = -1; + + float value = getValueForY(v, newy, avoid); + if (!m_editingCommand) { m_editingCommand = new RegionModel::EditCommand(m_model, tr("Drag Region")); } - if (m_verticalScale == EqualSpaced) { - if (getYForValue(v, value) != getYForValue(v, m_editingPoint.value)) { - m_dragYRebase = e->y(); - } - } - m_editingCommand->deletePoint(m_editingPoint); m_editingPoint.frame = frame; m_editingPoint.value = value; @@ -1057,7 +1072,6 @@ void RegionLayer::editEnd(View *, QMouseEvent *e) { - std::cerr << "RegionLayer::editEnd(" << e->x() << "," << e->y() << ")" << std::endl; if (!m_model || !m_editing) return; if (m_editingCommand) { Modified: sonic-visualiser/trunk/layer/RegionLayer.h =================================================================== --- sonic-visualiser/trunk/layer/RegionLayer.h 2009-09-29 10:34:57 UTC (rev 1641) +++ sonic-visualiser/trunk/layer/RegionLayer.h 2009-10-02 13:56:10 UTC (rev 1642) @@ -120,7 +120,7 @@ protected: void getScaleExtents(View *, float &min, float &max, bool &log) const; int getYForValue(View *v, float value) const; - float getValueForY(View *v, int y) const; + float getValueForY(View *v, int y, int avoid = -1) const; QColor getColourForValue(View *v, float value) const; virtual int getDefaultColourHint(bool dark, bool &impose); @@ -131,8 +131,10 @@ RegionModel *m_model; bool m_editing; - int m_dragYOrigin; - int m_dragYRebase; + int m_dragPointX; + int m_dragPointY; + int m_dragStartX; + int m_dragStartY; RegionModel::Point m_originalPoint; RegionModel::Point m_editingPoint; RegionModel::EditCommand *m_editingCommand; @@ -141,9 +143,13 @@ PlotStyle m_plotStyle; typedef std::map<float, int> SpacingMap; + // region value -> ordering SpacingMap m_spacingMap; + // region value -> number of regions with this value + SpacingMap m_distributionMap; + int spacingIndexToY(View *v, int i) const; float yToSpacingIndex(View *v, int y) const; Modified: sonic-visualiser/trunk/view/Pane.cpp =================================================================== --- sonic-visualiser/trunk/view/Pane.cpp 2009-09-29 10:34:57 UTC (rev 1641) +++ sonic-visualiser/trunk/view/Pane.cpp 2009-10-02 13:56:10 UTC (rev 1642) @@ -1558,39 +1558,30 @@ } else if (mode == ViewManager::EditMode) { - if (m_editing) { - if (!editSelectionDrag(e)) { - Layer *layer = getSelectedLayer(); - if (layer && layer->isLayerEditable()) { - layer->editDrag(this, e); - } - } + bool resist = true; + + if ((e->modifiers() & Qt::ShiftModifier)) { + m_shiftPressed = true; + // ... but don't set it false if shift has been + // released -- we want the state when we started + // dragging to be used most of the time } - if (!m_editing) { + if (m_shiftPressed) resist = false; - bool resist = true; + m_dragMode = updateDragMode + (m_dragMode, + m_clickPos, + e->pos(), + true, // can move horiz + true, // can move vert + resist, // resist horiz + resist); // resist vert - if ((e->modifiers() & Qt::ShiftModifier)) { - m_shiftPressed = true; - // ... but don't set it false if shift has been - // released -- we want the state when we started - // dragging to be used most of the time - } + if (!m_editing) { - if (m_shiftPressed) resist = false; + if (m_dragMode != UnresolvedDrag) { - DragMode newDragMode = updateDragMode - (m_dragMode, - m_clickPos, - e->pos(), - true, // can move horiz - true, // can move vert - resist, // resist horiz - resist); // resist vert - - if (newDragMode != UnresolvedDrag) { - m_editing = true; QMouseEvent clickEvent(QEvent::MouseButtonPress, @@ -1606,6 +1597,29 @@ } } } + + } else { + + if (!editSelectionDrag(e)) { + + Layer *layer = getSelectedLayer(); + + if (layer && layer->isLayerEditable()) { + + int x = e->x(); + int y = e->y(); + if (m_dragMode == VerticalDrag) x = m_clickPos.x(); + else if (m_dragMode == HorizontalDrag) y = m_clickPos.y(); + + QMouseEvent moveEvent(QEvent::MouseMove, + QPoint(x, y), + Qt::NoButton, + e->buttons(), + e->modifiers()); + + layer->editDrag(this, &moveEvent); + } + } } } else if (mode == ViewManager::MeasureMode) { @@ -1966,6 +1980,8 @@ m_dragStartMinValue = dmin; } } + + m_clickedInRange = false; // in case mouseReleaseEvent is not properly called } void @@ -2502,7 +2518,7 @@ //!!! could call through to layer if (editable) { - help = tr("Click and drag an item in the active layer to move it"); + help = tr("Click and drag an item in the active layer to move it; hold Shift to override initial resistance"); if (pos) { bool closeToLeft = false, closeToRight = false; Selection selection = getSelectionAt(pos->x(), closeToLeft, closeToRight); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-09-29 10:35:06
|
Revision: 1641 http://sv1.svn.sourceforge.net/sv1/?rev=1641&view=rev Author: cannam Date: 2009-09-29 10:34:57 +0000 (Tue, 29 Sep 2009) Log Message: ----------- * Support SMPTE timecode in MIDI files (fixes #2739160) Modified Paths: -------------- sonic-visualiser/trunk/data/fileio/MIDIFileReader.cpp sonic-visualiser/trunk/data/fileio/MIDIFileReader.h Modified: sonic-visualiser/trunk/data/fileio/MIDIFileReader.cpp =================================================================== --- sonic-visualiser/trunk/data/fileio/MIDIFileReader.cpp 2009-09-28 12:29:12 UTC (rev 1640) +++ sonic-visualiser/trunk/data/fileio/MIDIFileReader.cpp 2009-09-29 10:34:57 UTC (rev 1641) @@ -58,7 +58,10 @@ MIDIFileReader::MIDIFileReader(QString path, MIDIFileImportPreferenceAcquirer *acquirer, size_t mainModelSampleRate) : + m_smpte(false), m_timingDivision(0), + m_fps(0), + m_subframes(0), m_format(MIDI_FILE_BAD_FORMAT), m_numberOfTracks(0), m_trackByteCount(0), @@ -416,23 +419,14 @@ m_numberOfTracks = midiBytesToInt(midiHeader.substr(10,2)); m_timingDivision = midiBytesToInt(midiHeader.substr(12,2)); - if (m_format == MIDI_SEQUENTIAL_TRACK_FILE) { -#ifdef MIDI_DEBUG - cerr << "MIDIFileReader::parseHeader()" - << "- can't load sequential track file" - << endl; -#endif - return false; + if (m_timingDivision >= 32768) { + m_smpte = true; + m_fps = 256 - (m_timingDivision >> 8); + m_subframes = (m_timingDivision & 0xff); + } else { + m_smpte = false; } -#ifdef MIDI_DEBUG - if (m_timingDivision < 0) { - cerr << "MIDIFileReader::parseHeader()" - << " - file uses SMPTE timing" - << endl; - } -#endif - return true; } @@ -706,7 +700,7 @@ if (!noteOffFound) { MIDITrack::iterator j = m_midiComposition[track].end(); --j; - (*i)->setDuration((*j)->getTime() - (*i)->getTime()); + (*i)->setDuration((*j)->getTime() - (*i)->getTime()); } } } @@ -957,8 +951,15 @@ for (MIDITrack::const_iterator i = track.begin(); i != track.end(); ++i) { - RealTime rt = getTimeForMIDITime((*i)->getTime()); + RealTime rt; + unsigned long midiTime = (*i)->getTime(); + if (m_smpte) { + rt = RealTime::frame2RealTime(midiTime, m_fps * m_subframes); + } else { + rt = getTimeForMIDITime(midiTime); + } + // We ignore most of these event types for now, though in // theory some of the text ones could usefully be incorporated @@ -1006,8 +1007,13 @@ if ((*i)->getVelocity() == 0) break; // effective note-off else { - RealTime endRT = getTimeForMIDITime((*i)->getTime() + - (*i)->getDuration()); + RealTime endRT; + unsigned long endMidiTime = (*i)->getTime() + (*i)->getDuration(); + if (m_smpte) { + endRT = RealTime::frame2RealTime(endMidiTime, m_fps * m_subframes); + } else { + endRT = getTimeForMIDITime(endMidiTime); + } long startFrame = RealTime::realTime2Frame (rt, model->getSampleRate()); Modified: sonic-visualiser/trunk/data/fileio/MIDIFileReader.h =================================================================== --- sonic-visualiser/trunk/data/fileio/MIDIFileReader.h 2009-09-28 12:29:12 UTC (rev 1640) +++ sonic-visualiser/trunk/data/fileio/MIDIFileReader.h 2009-09-29 10:34:57 UTC (rev 1641) @@ -108,7 +108,10 @@ bool skipToNextTrack(); + bool m_smpte; int m_timingDivision; // pulses per quarter note + int m_fps; // if smpte + int m_subframes; // if smpte MIDIFileFormatType m_format; unsigned int m_numberOfTracks; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-09-28 12:31:04
|
Revision: 1640 http://sv1.svn.sourceforge.net/sv1/?rev=1640&view=rev Author: cannam Date: 2009-09-28 12:29:12 +0000 (Mon, 28 Sep 2009) Log Message: ----------- * Make a better job of picking the proper point to drag, edit, delete etc in note and region layers * Some work to do with region dragging, but this still needs more thought Modified Paths: -------------- sonic-visualiser/trunk/layer/NoteLayer.cpp sonic-visualiser/trunk/layer/NoteLayer.h sonic-visualiser/trunk/layer/RegionLayer.cpp sonic-visualiser/trunk/layer/RegionLayer.h Modified: sonic-visualiser/trunk/layer/NoteLayer.cpp =================================================================== --- sonic-visualiser/trunk/layer/NoteLayer.cpp 2009-09-28 10:39:13 UTC (rev 1639) +++ sonic-visualiser/trunk/layer/NoteLayer.cpp 2009-09-28 12:29:12 UTC (rev 1640) @@ -404,6 +404,34 @@ return usePoints; } +bool +NoteLayer::getPointToDrag(View *v, int x, int y, NoteModel::Point &p) const +{ + if (!m_model) return false; + + long frame = v->getFrameForX(x); + + NoteModel::PointList onPoints = m_model->getPoints(frame); + if (onPoints.empty()) return false; + + std::cerr << "frame " << frame << ": " << onPoints.size() << " candidate points" << std::endl; + + int nearestDistance = -1; + + for (NoteModel::PointList::const_iterator i = onPoints.begin(); + i != onPoints.end(); ++i) { + + int distance = getYForValue(v, (*i).value) - y; + if (distance < 0) distance = -distance; + if (nearestDistance == -1 || distance < nearestDistance) { + nearestDistance = distance; + p = *i; + } + } + + return true; +} + QString NoteLayer::getFeatureDescription(View *v, QPoint &pos) const { @@ -818,11 +846,13 @@ { if (!m_model) return; - NoteModel::PointList points = getLocalPoints(v, e->x()); - if (points.empty()) return; +// NoteModel::PointList points = getLocalPoints(v, e->x()); +// if (points.empty()) return; - m_editingPoint = *points.begin(); +// m_editingPoint = *points.begin(); + if (!getPointToDrag(v, e->x(), e->y(), m_editingPoint)) return; + if (m_editingCommand) { finish(m_editingCommand); m_editingCommand = 0; @@ -843,14 +873,19 @@ m_editing = false; +/* NoteModel::PointList points = getLocalPoints(v, e->x()); if (points.empty()) return; if (points.begin()->frame != m_editingPoint.frame || points.begin()->value != m_editingPoint.value) return; +*/ - m_editingCommand = new NoteModel::EditCommand - (m_model, tr("Erase Point")); + NoteModel::Point p(0); + if (!getPointToDrag(v, e->x(), e->y(), p)) return; + if (p.frame != m_editingPoint.frame || p.value != m_editingPoint.value) return; + m_editingCommand = new NoteModel::EditCommand(m_model, tr("Erase Point")); + m_editingCommand->deletePoint(m_editingPoint); finish(m_editingCommand); @@ -865,10 +900,14 @@ if (!m_model) return; +/* NoteModel::PointList points = getLocalPoints(v, e->x()); if (points.empty()) return; m_editingPoint = *points.begin(); +*/ + + if (!getPointToDrag(v, e->x(), e->y(), m_editingPoint)) return; m_originalPoint = m_editingPoint; if (m_editingCommand) { @@ -935,12 +974,16 @@ NoteLayer::editOpen(View *v, QMouseEvent *e) { if (!m_model) return false; - +/* NoteModel::PointList points = getLocalPoints(v, e->x()); if (points.empty()) return false; +*/ - NoteModel::Point note = *points.begin(); + NoteModel::Point note(0); + if (!getPointToDrag(v, e->x(), e->y(), note)) return false; +// NoteModel::Point note = *points.begin(); + ItemEditDialog *dialog = new ItemEditDialog (m_model->getSampleRate(), ItemEditDialog::ShowTime | Modified: sonic-visualiser/trunk/layer/NoteLayer.h =================================================================== --- sonic-visualiser/trunk/layer/NoteLayer.h 2009-09-28 10:39:13 UTC (rev 1639) +++ sonic-visualiser/trunk/layer/NoteLayer.h 2009-09-28 12:29:12 UTC (rev 1640) @@ -135,6 +135,8 @@ NoteModel::PointList getLocalPoints(View *v, int) const; + bool getPointToDrag(View *v, int x, int y, NoteModel::Point &) const; + NoteModel *m_model; bool m_editing; NoteModel::Point m_originalPoint; Modified: sonic-visualiser/trunk/layer/RegionLayer.cpp =================================================================== --- sonic-visualiser/trunk/layer/RegionLayer.cpp 2009-09-28 10:39:13 UTC (rev 1639) +++ sonic-visualiser/trunk/layer/RegionLayer.cpp 2009-09-28 12:29:12 UTC (rev 1640) @@ -327,6 +327,32 @@ return usePoints; } +bool +RegionLayer::getPointToDrag(View *v, int x, int y, RegionModel::Point &p) const +{ + if (!m_model) return false; + + long frame = v->getFrameForX(x); + + RegionModel::PointList onPoints = m_model->getPoints(frame); + if (onPoints.empty()) return false; + + int nearestDistance = -1; + + for (RegionModel::PointList::const_iterator i = onPoints.begin(); + i != onPoints.end(); ++i) { + + int distance = getYForValue(v, (*i).value) - y; + if (distance < 0) distance = -distance; + if (nearestDistance == -1 || distance < nearestDistance) { + nearestDistance = distance; + p = *i; + } + } + + return true; +} + QString RegionLayer::getFeatureDescription(View *v, QPoint &pos) const { @@ -760,6 +786,9 @@ textY = v->getTextLabelHeight(this, paint); } + int fontHeight = paint.fontMetrics().height(); + int fontAscent = paint.fontMetrics().ascent(); + for (RegionModel::PointList::const_iterator i = points.begin(); i != points.end(); ++i) { @@ -781,10 +810,9 @@ } if (m_plotStyle != PlotSegmentation) { - textY = y - paint.fontMetrics().height() - + paint.fontMetrics().ascent(); - if (textY < paint.fontMetrics().ascent() + 1) { - textY = paint.fontMetrics().ascent() + 1; + textY = y - fontHeight + fontAscent; + if (textY < fontAscent + 1) { + textY = fontAscent + 1; } } @@ -829,11 +857,11 @@ paint.drawLine(x+w, y - h/2, x + w, y + h/2); } - if (p.label != "") { -// if (ex > x + 6 + paint.fontMetrics().width(p.label)) { - paint.drawText(x + 5, textY, p.label); -// } - } + QString label = p.label; + if (label == "") { + label = QString("[%1]").arg(p.value); + } + v->drawVisibleText(paint, x + 5, textY, label, View::OutlinedText); } paint.restore(); @@ -852,7 +880,7 @@ float value = getValueForY(v, e->y()); - m_editingPoint = RegionModel::Point(frame, value, 0, tr("New Region")); + m_editingPoint = RegionModel::Point(frame, value, 0, ""); m_originalPoint = m_editingPoint; if (m_editingCommand) finish(m_editingCommand); @@ -860,6 +888,8 @@ tr("Draw Region")); m_editingCommand->addPoint(m_editingPoint); + recalcSpacing(); + m_editing = true; } @@ -891,6 +921,8 @@ m_editingPoint.value = newValue; m_editingPoint.duration = newDuration; m_editingCommand->addPoint(m_editingPoint); + +// recalcSpacing(); } void @@ -901,6 +933,8 @@ finish(m_editingCommand); m_editingCommand = 0; m_editing = false; + + recalcSpacing(); } void @@ -908,17 +942,20 @@ { if (!m_model) return; + if (!getPointToDrag(v, e->x(), e->y(), m_editingPoint)) return; +/* RegionModel::PointList points = getLocalPoints(v, e->x()); if (points.empty()) return; m_editingPoint = *points.begin(); - +*/ if (m_editingCommand) { finish(m_editingCommand); m_editingCommand = 0; } m_editing = true; + recalcSpacing(); } void @@ -932,11 +969,15 @@ if (!m_model || !m_editing) return; m_editing = false; - +/* RegionModel::PointList points = getLocalPoints(v, e->x()); if (points.empty()) return; if (points.begin()->frame != m_editingPoint.frame || points.begin()->value != m_editingPoint.value) return; +*/ + RegionModel::Point p(0); + if (!getPointToDrag(v, e->x(), e->y(), p)) return; + if (p.frame != m_editingPoint.frame || p.value != m_editingPoint.value) return; m_editingCommand = new RegionModel::EditCommand (m_model, tr("Erase Region")); @@ -946,19 +987,28 @@ finish(m_editingCommand); m_editingCommand = 0; m_editing = false; + recalcSpacing(); } void RegionLayer::editStart(View *v, QMouseEvent *e) { -// std::cerr << "RegionLayer::editStart(" << e->x() << "," << e->y() << ")" << std::endl; + std::cerr << "RegionLayer::editStart(" << e->x() << "," << e->y() << ")" << std::endl; if (!m_model) return; - RegionModel::PointList points = getLocalPoints(v, e->x()); - if (points.empty()) return; +// OrderedPointList opoints = getNearbyPoints(v, e->x(), e->y()); +// RegionLayer: - m_editingPoint = *points.begin(); +// RegionModel::PointList points = getLocalPoints(v, e->x()); +// if (points.empty()) return; + +// m_editingPoint = *points.begin(); + + if (!getPointToDrag(v, e->x(), e->y(), m_editingPoint)) { + return; + } + m_originalPoint = m_editingPoint; if (m_editingCommand) { @@ -967,12 +1017,15 @@ } m_editing = true; + m_dragYOrigin = e->y(); + m_dragYRebase = e->y(); + recalcSpacing(); } void RegionLayer::editDrag(View *v, QMouseEvent *e) { -// std::cerr << "RegionLayer::editDrag(" << e->x() << "," << e->y() << ")" << std::endl; + std::cerr << "RegionLayer::editDrag(" << e->x() << "," << e->y() << ")" << std::endl; if (!m_model || !m_editing) return; @@ -980,23 +1033,31 @@ if (frame < 0) frame = 0; frame = frame / m_model->getResolution() * m_model->getResolution(); - float value = getValueForY(v, e->y()); + int activeY = e->y() + (m_dragYRebase - m_dragYOrigin); + float value = getValueForY(v, activeY); if (!m_editingCommand) { m_editingCommand = new RegionModel::EditCommand(m_model, tr("Drag Region")); } + if (m_verticalScale == EqualSpaced) { + if (getYForValue(v, value) != getYForValue(v, m_editingPoint.value)) { + m_dragYRebase = e->y(); + } + } + m_editingCommand->deletePoint(m_editingPoint); m_editingPoint.frame = frame; m_editingPoint.value = value; m_editingCommand->addPoint(m_editingPoint); + recalcSpacing(); } void -RegionLayer::editEnd(View *, QMouseEvent *) +RegionLayer::editEnd(View *, QMouseEvent *e) { -// std::cerr << "RegionLayer::editEnd(" << e->x() << "," << e->y() << ")" << std::endl; + std::cerr << "RegionLayer::editEnd(" << e->x() << "," << e->y() << ")" << std::endl; if (!m_model || !m_editing) return; if (m_editingCommand) { @@ -1019,18 +1080,23 @@ m_editingCommand = 0; m_editing = false; + recalcSpacing(); } bool RegionLayer::editOpen(View *v, QMouseEvent *e) { if (!m_model) return false; - +/* RegionModel::PointList points = getLocalPoints(v, e->x()); if (points.empty()) return false; +*/ - RegionModel::Point region = *points.begin(); + RegionModel::Point region(0); + if (!getPointToDrag(v, e->x(), e->y(), region)) return false; +// RegionModel::Point region = *points.begin(); + ItemEditDialog *dialog = new ItemEditDialog (m_model->getSampleRate(), ItemEditDialog::ShowTime | @@ -1060,6 +1126,7 @@ } delete dialog; + recalcSpacing(); return true; } @@ -1086,6 +1153,7 @@ } finish(command); + recalcSpacing(); } void @@ -1125,6 +1193,7 @@ } finish(command); + recalcSpacing(); } void @@ -1147,6 +1216,7 @@ } finish(command); + recalcSpacing(); } void @@ -1244,6 +1314,7 @@ } finish(command); + recalcSpacing(); return true; } Modified: sonic-visualiser/trunk/layer/RegionLayer.h =================================================================== --- sonic-visualiser/trunk/layer/RegionLayer.h 2009-09-28 10:39:13 UTC (rev 1639) +++ sonic-visualiser/trunk/layer/RegionLayer.h 2009-09-28 12:29:12 UTC (rev 1640) @@ -125,10 +125,14 @@ virtual int getDefaultColourHint(bool dark, bool &impose); - RegionModel::PointList getLocalPoints(View *v, int) const; + RegionModel::PointList getLocalPoints(View *v, int x) const; + bool getPointToDrag(View *v, int x, int y, RegionModel::Point &) const; + RegionModel *m_model; bool m_editing; + int m_dragYOrigin; + int m_dragYRebase; RegionModel::Point m_originalPoint; RegionModel::Point m_editingPoint; RegionModel::EditCommand *m_editingCommand; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ca...@us...> - 2009-09-28 10:39:21
|
Revision: 1639 http://sv1.svn.sourceforge.net/sv1/?rev=1639&view=rev Author: cannam Date: 2009-09-28 10:39:13 +0000 (Mon, 28 Sep 2009) Log Message: ----------- * Add "Insert Item at Selection" (wording could be improved!) Modified Paths: -------------- sonic-visualiser/trunk/framework/MainWindowBase.cpp sonic-visualiser/trunk/framework/MainWindowBase.h sonic-visualiser/trunk/sv/main/MainWindow.cpp Modified: sonic-visualiser/trunk/framework/MainWindowBase.cpp =================================================================== --- sonic-visualiser/trunk/framework/MainWindowBase.cpp 2009-09-25 12:16:31 UTC (rev 1638) +++ sonic-visualiser/trunk/framework/MainWindowBase.cpp 2009-09-28 10:39:13 UTC (rev 1639) @@ -34,6 +34,8 @@ #include "layer/SliceLayer.h" #include "layer/SliceableLayer.h" #include "layer/ImageLayer.h" +#include "layer/NoteLayer.h" +#include "layer/RegionLayer.h" #include "widgets/ListInputDialog.h" #include "widgets/CommandHistory.h" @@ -371,6 +373,10 @@ bool haveCurrentTimeInstantsLayer = (haveCurrentLayer && dynamic_cast<TimeInstantLayer *>(currentLayer)); + bool haveCurrentDurationLayer = + (haveCurrentLayer && + (dynamic_cast<NoteLayer *>(currentLayer) || + dynamic_cast<RegionLayer *>(currentLayer))); bool haveCurrentColour3DPlot = (haveCurrentLayer && dynamic_cast<Colour3DPlotLayer *>(currentLayer)); @@ -404,6 +410,7 @@ emit canPaste(haveClipboardContents); emit canInsertInstant(haveCurrentPane); emit canInsertInstantsAtBoundaries(haveCurrentPane && haveSelection); + emit canInsertItemAtSelection(haveCurrentPane && haveSelection && haveCurrentDurationLayer); emit canRenumberInstants(haveCurrentTimeInstantsLayer && haveSelection); emit canPlaySelection(haveMainModel && havePlayTarget && haveSelection); emit canClearSelection(haveSelection); @@ -753,8 +760,8 @@ size_t start = i->getStartFrame(); size_t end = i->getEndFrame(); if (start != end) { - insertInstantAt(i->getStartFrame()); - insertInstantAt(i->getEndFrame()); + insertInstantAt(start); + insertInstantAt(end); } } } @@ -847,6 +854,84 @@ } void +MainWindowBase::insertItemAtSelection() +{ + MultiSelection::SelectionList selections = m_viewManager->getSelections(); + for (MultiSelection::SelectionList::iterator i = selections.begin(); + i != selections.end(); ++i) { + size_t start = i->getStartFrame(); + size_t end = i->getEndFrame(); + if (start < end) { + insertItemAt(start, end - start); + } + } +} + +void +MainWindowBase::insertItemAt(size_t frame, size_t duration) +{ + Pane *pane = m_paneStack->getCurrentPane(); + if (!pane) { + return; + } + + // ugh! + + size_t alignedStart = pane->alignFromReference(frame); + size_t alignedEnd = pane->alignFromReference(frame + duration); + if (alignedStart >= alignedEnd) return; + size_t alignedDuration = alignedEnd - alignedStart; + + Command *c = 0; + + QString name = tr("Add Item at %1 s") + .arg(RealTime::frame2RealTime + (alignedStart, + getMainModel()->getSampleRate()) + .toText(false).c_str()); + + Layer *layer = pane->getSelectedLayer(); + if (!layer) return; + + RegionModel *rm = dynamic_cast<RegionModel *>(layer->getModel()); + if (rm) { + RegionModel::Point point(alignedStart, + rm->getValueMinimum(), + alignedDuration, + ""); + RegionModel::EditCommand *command = + new RegionModel::EditCommand(rm, tr("Add Point")); + command->addPoint(point); + command->setName(name); + c = command->finish(); + } + + if (c) { + CommandHistory::getInstance()->addCommand(c, false); + return; + } + + NoteModel *nm = dynamic_cast<NoteModel *>(layer->getModel()); + if (nm) { + NoteModel::Point point(alignedStart, + rm->getValueMinimum(), + alignedDuration, + 1.f, + ""); + NoteModel::EditCommand *command = + new NoteModel::EditCommand(nm, tr("Add Point")); + command->addPoint(point); + command->setName(name); + c = command->finish(); + } + + if (c) { + CommandHistory::getInstance()->addCommand(c, false); + return; + } +} + +void MainWindowBase::renumberInstants() { Pane *pane = m_paneStack->getCurrentPane(); Modified: sonic-visualiser/trunk/framework/MainWindowBase.h =================================================================== --- sonic-visualiser/trunk/framework/MainWindowBase.h 2009-09-25 12:16:31 UTC (rev 1638) +++ sonic-visualiser/trunk/framework/MainWindowBase.h 2009-09-28 10:39:13 UTC (rev 1639) @@ -129,6 +129,7 @@ void canPaste(bool); void canInsertInstant(bool); void canInsertInstantsAtBoundaries(bool); + void canInsertItemAtSelection(bool); void canRenumberInstants(bool); void canDeleteCurrentLayer(bool); void canZoom(bool); @@ -224,6 +225,8 @@ virtual void insertInstant(); virtual void insertInstantAt(size_t); virtual void insertInstantsAtBoundaries(); + virtual void insertItemAtSelection(); + virtual void insertItemAt(size_t, size_t); virtual void renumberInstants(); virtual void documentModified(); Modified: sonic-visualiser/trunk/sv/main/MainWindow.cpp =================================================================== --- sonic-visualiser/trunk/sv/main/MainWindow.cpp 2009-09-25 12:16:31 UTC (rev 1638) +++ sonic-visualiser/trunk/sv/main/MainWindow.cpp 2009-09-28 10:39:13 UTC (rev 1639) @@ -625,6 +625,16 @@ m_keyReference->registerShortcut(action); menu->addAction(action); + action = new QAction(tr("Insert Item at Selection"), this); + action->setShortcut(tr("Ctrl+Shift+Enter")); + action->setStatusTip(tr("Insert a new note or region item corresponding to the current selection")); + connect(action, SIGNAL(triggered()), this, SLOT(insertItemAtSelection())); + connect(this, SIGNAL(canInsertItemAtSelection(bool)), action, SLOT(setEnabled(bool))); + m_keyReference->registerShortcut(action); + menu->addAction(action); + + menu->addSeparator(); + QMenu *numberingMenu = menu->addMenu(tr("Number New Instants with")); numberingMenu->setTearOffEnabled(true); QActionGroup *numberingGroup = new QActionGroup(this); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |