Skip to content

Commit

Permalink
Feat add menu and preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
Greedysky committed Feb 8, 2023
1 parent 1db0c89 commit 2b63511
Show file tree
Hide file tree
Showing 75 changed files with 5,519 additions and 92 deletions.
Empty file modified .github/FUNDING.yml
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
127 changes: 127 additions & 0 deletions QtSpek.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
#-------------------------------------------------
#
# Project created by QtCreator 2017-07-18T21:45:15
#
#-------------------------------------------------

QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

DESTDIR = $$OUT_PWD/bin
TEMPLATE = app
TARGET = spek

QMAKE_CXXFLAGS += -std=c++11

#change to your libav or ffmpeg lib
INCLUDEPATH += /home/greedysky/qmmp_all/qmmp/extra/gcc/libffmpeg/include
LIBS += -L/home/greedysky/qmmp_all/qmmp/extra/gcc/libffmpeg/lib -lavcodec -lavformat -lavutil -lswresample

SOURCES += \
src/main.cpp \
src/spek-audio.cc \
src/spek-fft.cc \
src/spek-palette.cc \
src/spek-pipeline.cc \
src/spek-platform.cc \
src/spek-preferences.cc \
src/spek-preferences-dialog.cc \
src/spek-ruler.cc \
src/spek-spectrogram.cc \
src/spek-utils.cc \
src/spek-window.cc

HEADERS += \
src/spek.h \
src/spek-audio.h \
src/spek-fft.h \
src/spek-palette.h \
src/spek-pipeline.h \
src/spek-platform.h \
src/spek-preferences.h \
src/spek-preferences-dialog.h \
src/spek-ruler.h \
src/spek-spectrogram.h \
src/spek-utils.h \
src/spek-window.h

RESOURCES += images/images.qrc

win32:RC_FILE = $$PWD/QtSpek.rc

TRANSLATIONS += \
$$PWD/po/bs.ts \
$$PWD/po/ca.ts \
$$PWD/po/cs.ts \
$$PWD/po/da.ts \
$$PWD/po/de.ts \
$$PWD/po/el.ts \
$$PWD/po/en.ts \
$$PWD/po/eo.ts \
$$PWD/po/es.ts \
$$PWD/po/fi.ts \
$$PWD/po/fr.ts \
$$PWD/po/gl.ts \
$$PWD/po/he.ts \
$$PWD/po/hr.ts \
$$PWD/po/hu.ts \
$$PWD/po/id.ts \
$$PWD/po/it.ts \
$$PWD/po/ja.ts \
$$PWD/po/ko.ts \
$$PWD/po/lv.ts \
$$PWD/po/nb.ts \
$$PWD/po/nl.ts \
$$PWD/po/nn.ts \
$$PWD/po/pl.ts \
$$PWD/po/pt_BR.ts \
$$PWD/po/ru.ts \
$$PWD/po/sk.ts \
$$PWD/po/sr@latin.ts \
$$PWD/po/sv.ts \
$$PWD/po/th.ts \
$$PWD/po/tr.ts \
$$PWD/po/uk.ts \
$$PWD/po/vi.ts \
$$PWD/po/zh_CN.ts \
$$PWD/po/zh_TW.ts

##find translation
unix:exists($$[QT_INSTALL_BINS]/lrelease){
LRELEASE_EXECUTABLE = $$[QT_INSTALL_BINS]/lrelease
}

unix:exists($$[QT_INSTALL_BINS]/lrelease-qt5){
LRELEASE_EXECUTABLE = $$[QT_INSTALL_BINS]/lrelease-qt5
}

win32:exists($$[QT_INSTALL_BINS]/lrelease.exe){
LRELEASE_EXECUTABLE = $$[QT_INSTALL_BINS]/lrelease.exe
}

isEmpty(LRELEASE_EXECUTABLE){
error(Could not find lrelease executable)
}else{
message(Found lrelease executable: $$LRELEASE_EXECUTABLE)
}

##update translation
unix{
output = $$OUT_PWD/bin/po
!exists($$output):system(mkdir -p $$output)

system(find $$PWD/po -name *.ts | xargs $$LRELEASE_EXECUTABLE)
system(find $$PWD/po -name *.qm | xargs rename -v -f 's/.qm/.ln/' *)
system(for F in $$PWD/po/*.ln ; do mv $F $$output ;done)
}

win32{
output = $$OUT_PWD/bin/po
output = $$replace(output, /, \\)
!exists($$output):system(md $$output)

system(for /r $$PWD/po %i in (*.ts) do $$LRELEASE_EXECUTABLE %i)
system(for /r $$PWD/po %i in (*.qm) do ren %i *.ln)
system(for /r $$PWD/po %i in (*.ln) do move /y %i $$output)
}
1 change: 1 addition & 0 deletions QtSpek.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IDI_ICON1 ICON DISCARDABLE "images/spek.ico"
6 changes: 3 additions & 3 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Qt-spek
# QtSpek
基于Qt的频谱分析器

修改于Spek[官网地址](http://spek.cc), [Github仓库地址](https://github.com/alexkay/spek)

![0](https://github.com/Greedysky/qt-spek/blob/master/demo.jpg?raw=true)
![1](https://github.com/Greedysky/qt-spek/blob/master/demo2.jpg?raw=true)
![0](https://github.com/Greedysky/qt-spek/blob/master/resource/demo.jpg?raw=true)
![1](https://github.com/Greedysky/qt-spek/blob/master/resource/demo2.jpg?raw=true)

## Spectrogram

Expand Down
Binary file added images/help.ico
Binary file not shown.
8 changes: 8 additions & 0 deletions images/images.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<RCC>
<qresource prefix="/">
<file>help.ico</file>
<file>open.ico</file>
<file>save.ico</file>
<file alias="logo" >spek.png</file>
</qresource>
</RCC>
Binary file added images/open.ico
Binary file not shown.
Binary file added images/save.ico
Binary file not shown.
Binary file added images/spek.ico
Binary file not shown.
Binary file added images/spek.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 0 additions & 14 deletions main.cpp

This file was deleted.

137 changes: 137 additions & 0 deletions po/bs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>S:</name>
<message>
<location filename="../src/spek-pipeline.cc" line="201"/>
<source></source>
<comment>keep &quot;-00&quot; unchanged, it&apos;s used to calc the text width</comment>
<translation></translation>
</message>
</context>
<context>
<name>SpekPreferencesDialog</name>
<message>
<location filename="../src/spek-preferences-dialog.cc" line="56"/>
<source>Preferences</source>
<translation type="unfinished">Podešavanja</translation>
</message>
<message>
<location filename="../src/spek-preferences-dialog.cc" line="59"/>
<source>General</source>
<translation type="unfinished">Generalno</translation>
</message>
<message>
<location filename="../src/spek-preferences-dialog.cc" line="71"/>
<source>Language:</source>
<translation type="unfinished">Jezik:</translation>
</message>
<message>
<location filename="../src/spek-preferences-dialog.cc" line="86"/>
<source>(system default)</source>
<translation type="unfinished">(sistemski podrazumijevano)</translation>
</message>
<message>
<location filename="../src/spek-preferences-dialog.cc" line="100"/>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SpekWindow</name>
<message>
<location filename="../src/spek-window.cc" line="52"/>
<source>Spek - Acoustic Spectrum Analyser</source>
<translation type="unfinished">Spek - Akustični analizator spektra</translation>
</message>
<message>
<location filename="../src/spek-window.cc" line="56"/>
<source>&amp;File</source>
<translation type="unfinished">&amp;Datoteka</translation>
</message>
<message>
<location filename="../src/spek-window.cc" line="57"/>
<location filename="../src/spek-window.cc" line="71"/>
<source>Open(O)...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/spek-window.cc" line="58"/>
<location filename="../src/spek-window.cc" line="72"/>
<source>Save(S)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/spek-window.cc" line="60"/>
<source>Quit(Q)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/spek-window.cc" line="62"/>
<source>&amp;Edit</source>
<translation type="unfinished">&amp;Uredi</translation>
</message>
<message>
<location filename="../src/spek-window.cc" line="63"/>
<source>Preferences</source>
<translation type="unfinished">Podešavanja</translation>
</message>
<message>
<location filename="../src/spek-window.cc" line="65"/>
<source>&amp;Help</source>
<translation type="unfinished">&amp;Pomoć</translation>
</message>
<message>
<location filename="../src/spek-window.cc" line="66"/>
<location filename="../src/spek-window.cc" line="76"/>
<source>Help</source>
<translation type="unfinished">Pomoć</translation>
</message>
<message>
<location filename="../src/spek-window.cc" line="67"/>
<source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/spek-window.cc" line="101"/>
<source>All files</source>
<translation type="unfinished">Sve datoteke</translation>
</message>
<message>
<location filename="../src/spek-window.cc" line="104"/>
<source>Audio files</source>
<translation type="unfinished">Audio datoteke</translation>
</message>
<message>
<location filename="../src/spek-window.cc" line="116"/>
<source>Open File</source>
<translation type="unfinished">Otvori datoteku</translation>
</message>
<message>
<location filename="../src/spek-window.cc" line="125"/>
<source>PNG images</source>
<translation type="unfinished">PNG slike</translation>
</message>
<message>
<location filename="../src/spek-window.cc" line="130"/>
<source>Untitled</source>
<translation type="unfinished">Bez naslova</translation>
</message>
<message>
<location filename="../src/spek-window.cc" line="133"/>
<source>Save Spectrogram</source>
<translation type="unfinished">Sačuvaj spektogram</translation>
</message>
<message>
<location filename="../src/spek-window.cc" line="157"/>
<source>Copyright (c) 2010-2013 Alexander Kojevnikov and contributors</source>
<translation type="unfinished">Copyright (c) 2010-2013 Alexander Kojevnikov i ostali kontributori</translation>
</message>
<message>
<location filename="../src/spek-window.cc" line="181"/>
<source>translator-credits</source>
<translation type="unfinished">zasluge-za-prevod</translation>
</message>
</context>
</TS>
Loading

0 comments on commit 2b63511

Please sign in to comment.