Skip to content

Commit

Permalink
0.1.9 release
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmolka committed Dec 5, 2018
1 parent 380dc18 commit 01e7d94
Show file tree
Hide file tree
Showing 20 changed files with 163 additions and 66 deletions.
2 changes: 1 addition & 1 deletion egg-player.pri
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RC_ICONS = resource/images/egg/egg.ico

VERSION = 0.1.8.5
VERSION = 0.1.9.0

QMAKE_TARGET = Egg Player
QMAKE_TARGET_PRODUCT = Egg Player
Expand Down
24 changes: 14 additions & 10 deletions egg-player.pro
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ RESOURCES = egg-player.qrc
DEFINES *= QT_USE_QSTRINGBUILDER

HEADERS += \
src/core/audios/audiosbase.hpp \
src/core/audios/currentstate.hpp \
src/core/bass/basserror.hpp \
src/core/bass/streamwrapper.hpp \
Expand All @@ -54,10 +55,12 @@ HEADERS += \
src/core/database/queryobject.hpp \
src/core/database/sqlquery.hpp \
src/core/database/tableitem.hpp \
src/core/filesystem/directory.hpp \
src/core/filesystem/filesystemwatcher.hpp \
src/core/filesystem/uniquefileinfo.hpp \
src/core/filesystem/windowsfile.hpp \
src/core/audio.hpp \
src/core/audiofinder.hpp \
src/core/audios.hpp \
src/core/bass.hpp \
src/core/bimap.hpp \
Expand All @@ -66,12 +69,14 @@ HEADERS += \
src/core/constants.hpp \
src/core/cover.hpp \
src/core/duration.hpp \
src/core/filesystem.hpp \
src/core/iconcreator.hpp \
src/core/library.hpp \
src/core/logger.hpp \
src/core/macros.hpp \
src/core/player.hpp \
src/core/playlist.hpp \
src/core/readablevector.hpp \
src/core/shortcut.hpp \
src/core/shortcutprocessor.hpp \
src/core/singleton.hpp \
Expand All @@ -95,6 +100,7 @@ HEADERS += \
src/widgets/barwidget.hpp \
src/widgets/borderlayout.hpp \
src/widgets/clickablestyle.hpp \
src/widgets/durationslider.hpp \
src/widgets/eggwidget.hpp \
src/widgets/iconbutton.hpp \
src/widgets/librarywidget.hpp \
Expand All @@ -106,13 +112,10 @@ HEADERS += \
src/widgets/smoothtablewidget.hpp \
src/widgets/tablewidget.hpp \
src/widgets/volumebutton.hpp \
src/core/filesystem/directory.hpp \
src/core/filesystem.hpp \
src/core/readablevector.hpp \
src/core/audios/audiosbase.hpp \
src/core/audiofinder.hpp
src/widgets/volumeslider.hpp

SOURCES += \
src/core/audios/audiosbase.cpp \
src/core/audios/currentstate.cpp \
src/core/bass/basserror.cpp \
src/core/bass/streamwrapper.cpp \
Expand All @@ -129,17 +132,20 @@ SOURCES += \
src/core/database/infoitem.cpp \
src/core/database/queryobject.cpp \
src/core/database/sqlquery.cpp \
src/core/filesystem/directory.cpp \
src/core/filesystem/filesystemwatcher.cpp \
src/core/filesystem/uniquefileinfo.cpp \
src/core/filesystem/windowsfile.cpp \
src/core/audio.cpp \
src/core/audiofinder.cpp \
src/core/audios.cpp \
src/core/bass.cpp \
src/core/cache.cpp \
src/core/config.cpp \
src/core/constants.cpp \
src/core/cover.cpp \
src/core/duration.cpp \
src/core/filesystem.cpp \
src/core/iconcreator.cpp \
src/core/library.cpp \
src/core/logger.cpp \
Expand All @@ -165,6 +171,7 @@ SOURCES += \
src/widgets/barwidget.cpp \
src/widgets/borderlayout.cpp \
src/widgets/clickablestyle.cpp \
src/widgets/durationslider.cpp \
src/widgets/eggwidget.cpp \
src/widgets/iconbutton.cpp \
src/widgets/librarywidget.cpp \
Expand All @@ -176,8 +183,5 @@ SOURCES += \
src/widgets/smoothtablewidget.cpp \
src/widgets/tablewidget.cpp \
src/widgets/volumebutton.cpp \
src/main.cpp \
src/core/filesystem/directory.cpp \
src/core/filesystem.cpp \
src/core/audios/audiosbase.cpp \
src/core/audiofinder.cpp
src/main.cpp

35 changes: 28 additions & 7 deletions resource/css/bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
* The css files should only be used to edit color related things. All other
* values can and should changed through the config. The following values will
* be replaced by config values.
* - groove-height
* - groove-size-duration
* - groove-size-volume
* - handle-size
* - handle-size-half
* - handle-size-pressed
* - handle-size-pressed-half
* - icon-size-half
*/

Expand All @@ -20,12 +23,20 @@ LockableIconButton[locked=true] {
background: rgba(255, 255, 255, 0.3);
}

Slider::groove:horizontal {
Slider::sub-page {
background: white;
}

Slider::add-page {
background: rgb(150, 150, 150);
height: groove-height;
}

Slider::handle:horizontal {
DurationSlider::groove:horizontal {
background: rgb(150, 150, 150);
height: groove-size-duration;
}

DurationSlider::handle:horizontal {
background: white;
width: handle-size;
height: handle-size;
Expand All @@ -34,10 +45,20 @@ Slider::handle:horizontal {
border-radius: handle-size-half;
}

Slider::sub-page {
DurationSlider::handle:horizontal:hover {
background: rgb(175, 175, 175);
}

DurationSlider::handle:horizontal:pressed {
background: white;
width: handle-size-pressed;
height: handle-size-pressed;
margin-top: -handle-size-pressed-half;
margin-bottom: -handle-size-pressed-half;
border-radius: handle-size-pressed-half;
}

Slider::add-page {
background: rgb(150, 150, 150);
VolumeSlider::groove:horizontal {
background: rgb(150, 150, 150);
height: groove-size-volume;
}
2 changes: 1 addition & 1 deletion src/core/audiofinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void AudioFinder::addKey(const QString &key)
m_reset.start(qApp->keyboardInputInterval());
}

int AudioFinder::search()
int AudioFinder::find()
{
if (!m_audios || m_index == -1 || m_string.isEmpty())
return -1;
Expand Down
4 changes: 2 additions & 2 deletions src/core/audiofinder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ class AudioFinder : public QObject
Q_OBJECT

public:
AudioFinder(QObject *parent = nullptr);
explicit AudioFinder(QObject *parent = nullptr);

void setAudios(Audios *audios);
void addKey(const QString &key);

int search();
int find();

private slots:
void reset();
Expand Down
4 changes: 2 additions & 2 deletions src/core/bass/syncwrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class SyncWrapper : protected BassError
public:
SyncWrapper();

EGG_CPROP(std::function<void(void *)>, function, setFunction, function)
EGG_PPROP(void *, functionData, setFunctionData, functionData)
EGG_C_PROP(std::function<void(void *)>, function, setFunction, function)
EGG_P_PROP(void *, functionData, setFunctionData, functionData)

bool isValid() const;

Expand Down
34 changes: 28 additions & 6 deletions src/core/config/barjson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,30 @@ QJsonObject cfg::SliderJson::toObject() const

void cfg::SliderJson::setDefaults()
{
setDefault("grooveHeight", 2);
setDefault("handleSize", 16);
setDefault("grooveSizeDuration", 2);
setDefault("grooveSizeVolume", 6);
setDefault("handleSize", 14);
setDefault("handleSizePressed", 16);
}

void cfg::SliderJson::setGrooveHeight(int height)
void cfg::SliderJson::setGrooveSizeDuration(int height)
{
set("grooveHeight", height);
set("grooveSizeDuration", height);
}

int cfg::SliderJson::grooveHeight() const
int cfg::SliderJson::grooveSizeDuration() const
{
return scale(get("grooveHeight").toInt());
return scale(get("grooveSizeDuration").toInt());
}

void cfg::SliderJson::setGrooveSizeVolume(int height)
{
set("grooveSizeVolume", height);
}

int cfg::SliderJson::grooveSizeVolume() const
{
return scale(get("grooveSizeVolume").toInt());
}

void cfg::SliderJson::setHandleSize(int size)
Expand All @@ -72,6 +84,16 @@ int cfg::SliderJson::handleSize() const
return scale(get("handleSize").toInt());
}

void cfg::SliderJson::setHandleSizePressed(int size)
{
set("handleSizePressed", size);
}

int cfg::SliderJson::handleSizePressed() const
{
return scale(get("handleSizePressed").toInt());
}

void cfg::BarJson::loadFromObject(const QJsonObject &object)
{
setObject(object);
Expand Down
10 changes: 8 additions & 2 deletions src/core/config/barjson.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,17 @@ class SliderJson : public JsonObject

void setDefaults() override;

void setGrooveHeight(int height);
int grooveHeight() const;
void setGrooveSizeDuration(int height);
int grooveSizeDuration() const;

void setGrooveSizeVolume(int height);
int grooveSizeVolume() const;

void setHandleSize(int size);
int handleSize() const;

void setHandleSizePressed(int size);
int handleSizePressed() const;
};

class BarJson : public JsonObject
Expand Down
3 changes: 2 additions & 1 deletion src/core/config/libraryjson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ void cfg::LibraryJson::setPaths(const QStrings &paths)
QStrings cfg::LibraryJson::paths() const
{
QStrings paths;
for (const QJsonValue &value : get("paths").toArray())
const QJsonArray values = get("paths").toArray();
for (const QJsonValue &value : values)
paths << value.toString();

return paths;
Expand Down
4 changes: 2 additions & 2 deletions src/core/database/infoitem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class InfoItem : public TableItem
public:
InfoItem();

EGG_PPROP(int, id, setId, id)
EGG_PPROP(int, version, setVersion, version)
EGG_P_PROP(int, id, setId, id)
EGG_P_PROP(int, version, setVersion, version)

bool exists();
bool insert();
Expand Down
3 changes: 0 additions & 3 deletions src/core/macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,4 @@
static_cast<const cls &>( \
*this).func()) \

#define EGG_PPROP EGG_P_PROP
#define EGG_CPROP EGG_C_PROP

#endif // MACROS_HPP
16 changes: 8 additions & 8 deletions src/core/tag.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ class Tag
Tag();
explicit Tag(const QString &file);

EGG_CPROP(QString, file, setFile, file)
EGG_CPROP(QString, title, setTitle, title)
EGG_CPROP(QString, artist, setArtist, artist)
EGG_CPROP(QString, album, setAlbum, album)
EGG_CPROP(QString, genre, setGenre, genre)
EGG_PPROP(int, year, setYear, year)
EGG_PPROP(int, track, setTrack, track)
EGG_PPROP(int, duration, setDuration, duration)
EGG_C_PROP(QString, file, setFile, file)
EGG_C_PROP(QString, title, setTitle, title)
EGG_C_PROP(QString, artist, setArtist, artist)
EGG_C_PROP(QString, album, setAlbum, album)
EGG_C_PROP(QString, genre, setGenre, genre)
EGG_P_PROP(int, year, setYear, year)
EGG_P_PROP(int, track, setTrack, track)
EGG_P_PROP(int, duration, setDuration, duration)

bool read();
};
Expand Down
4 changes: 2 additions & 2 deletions src/threading/thread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class Thread : public QThread
public:
explicit Thread(QObject *parent = nullptr);

EGG_PPROP(int, objects, setObjects, objects)
EGG_PPROP(int, maxObjects, setMaxObjects, maxObjects)
EGG_P_PROP(int, objects, setObjects, objects)
EGG_P_PROP(int, maxObjects, setMaxObjects, maxObjects)

void incrementObjects();
void decrementObjects();
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/audioswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void AudiosWidget::keyboardSearch(const QString &search)
void AudiosWidget::keyPressEvent(QKeyEvent *event)
{
m_finder.addKey(event->text());
const int row = m_finder.search();
const int row = m_finder.find();
if (row != -1)
{
scrollTo(model()->index(row, 0));
Expand Down
24 changes: 17 additions & 7 deletions src/widgets/barwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ BarWidget::BarWidget(QWidget *parent)
connect(&m_loopButton, &LockableIconButton::locked, &egg_player.playlist(), &Playlist::setLoop);
connect(&m_volumeButton, &IconButton::released, this, &BarWidget::onVolumeButtonPressed);

connect(&m_durationSlider, &Slider::sliderMoved, this, &BarWidget::onDurationSliderMoved);
connect(&m_durationSlider, &Slider::sliderValueChanged, &egg_player, &Player::setPosition);
connect(&m_volumeSlider, &Slider::sliderMoved, &egg_player, &Player::setVolume);
connect(&m_durationSlider, &DurationSlider::sliderMoved, this, &BarWidget::onDurationSliderMoved);
connect(&m_durationSlider, &DurationSlider::sliderValueChanged, &egg_player, &Player::setPosition);
connect(&m_volumeSlider, &VolumeSlider::sliderMoved, &egg_player, &Player::setVolume);
}

void BarWidget::setColor(const QColor &color)
Expand Down Expand Up @@ -182,10 +182,20 @@ void BarWidget::initUi()

void BarWidget::initStyle()
{
const int grooveSizeDuration = cfg_bar.slider().grooveSizeDuration();
const int grooveSizeVolume = cfg_bar.slider().grooveSizeVolume();
const int handleSize = cfg_bar.slider().handleSize();
const int handleSizePressed = cfg_bar.slider().handleSizePressed();
const int iconSize = cfg_bar.iconSize();

setStyleSheet(FileUtil::read(constants::css::Bar)
.replace("groove-height", QString::number(cfg_bar.slider().grooveHeight()))
.replace("handle-size-half", QString::number(cfg_bar.slider().handleSize() / 2))
.replace("handle-size", QString::number(cfg_bar.slider().handleSize()))
.replace("icon-size-half", QString::number(cfg_bar.iconSize() / 2))
.replace("groove-size-duration", QString::number(grooveSizeDuration))
.replace("groove-size-volume", QString::number(grooveSizeVolume))
.replace("handle-size-pressed-half", QString::number(handleSizePressed / 2))
.replace("handle-size-pressed", QString::number(handleSizePressed))
.replace("handle-size-half", QString::number(handleSize / 2))
.replace("handle-size", QString::number(handleSize))
.replace("icon-size-half", QString::number(iconSize / 2))

);
}
Loading

0 comments on commit 01e7d94

Please sign in to comment.