122 Commits

Author SHA1 Message Date
Oscar Cerna
5713b489cd removed build folder 2017-05-04 01:49:36 -07:00
Oscar Cerna
573353b188 ignoring debug build directory 2017-05-04 01:47:27 -07:00
Oscar Cerna
6722b95ded Made volume sliders more touch friendly. 2017-05-04 01:44:47 -07:00
rikai
347124c9e7 Merge pull request #10 from aszlig/refactor
Cleanup, refactor and implement save/restore
2017-05-03 20:45:55 -07:00
Ryan Moeller
b3e58bddcc
Add .gitignore 2017-05-03 12:14:42 +02:00
aszlig
d1711e7789
CasterBoard: Refactor further + make more readable
The pull request made by @freqlabs is much more readable, because it
also gets rid of the hardcoded grid coordinates.

So this is mainly a rebase of his commit 04f5d1d92c3cc8b2d0312961b4d589
in #9 on top of my changes:

    Use a QMap to simplify CasterBoard

    Instead of using separate member variables for every player, a
    single map can both store the players and provide a convenient
    mechanism for mapping key press events to the appropriate player.

    The map uses a Qt::Key symbol as the key and stores the pointer to
    each widget as the value.

    To populate the map, we iterate over each character in a string,
    where the characters correspond to the labels of the hotkey widgets.
    The corresponding Qt::Key values are stored in another array that is
    accessed in parallel. A counter keeps track of the offset in the
    keys array and is also used to calculate the grid position of each
    widget.

Instead of a map I'm still using a QHash, because it doesn't allow for
duplicates and is also faster in lookup.

I've also noticed that he's been using C++11 constructs, so I'm also
using these for saveLayout() and restoreLayout() as well.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @freqlabs
2017-05-03 12:10:03 +02:00
aszlig
d48cfbf72d
Save and restore layout on exit/startup
We already have a map of all the keys and their corresponding
CasterBoardLayout values, which link to the corresponding widget.

So when closing the window, the layout is saved using QSettings within
the [boards] section in an array mapping from the key id to the file
name, which looks like this:

[boards]
1\49=/path/to/foo.ogg
1\title=aaa
2\69=/path/to/bar.flac
2\title=bbb
size=2

Of course, if we have more complex layouts which doesn't involve a grid,
this will fall short, but we can still implement this once that's the
case.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Fixes: #3
2017-05-03 11:31:14 +02:00
aszlig
8156d69784
Move CasterBoardLayout class into its own file
We're going to extend that class, so let's give it its own file.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2017-05-03 11:31:11 +02:00
aszlig
a9a9264eea
board: Refactor to use a single hash for layout
Having all the keys copy & pasted all over the place is a lot of churn
and doesn't need to be like that.

We're heading on to saving the state of the board layout and duplicating
even more of these lines all over the place is not magically cleaning up
the code.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2017-05-03 11:31:08 +02:00
aszlig
f4e59f85a8
default.nix: Add all gstreamer plugins
This was the reason audio wasn't working for me so far.

In the long term however I think it would be a good idea to actually
show an error dialogue with detailed information if that happens.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2017-05-03 11:31:03 +02:00
aszlig
0c9fdcbc9b
player: Allow to select a file instead of dragging
This is mainly useful because I'm using a tiling WM and don't have a lot
of applications available (well, except Chromium, but that's still very
much annoying while testing) for dragging and dropping files into
CasterSoundboard.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2017-05-03 11:31:00 +02:00
aszlig
78a95c8bfe
player: Factor out state into a single State enum
This not only gives a bit more information about what's going on within
a specific player tile, but we now have a single state property which we
can use to boil down all the various states of the subwidgets to the
CasterPlayer class.

Right now we do not yet take into account the QMediaPlayer's state, but
that's something for future improvements.

So the result is now that the user now should no longer be in the dark
if Qt Multimedia fails to load a file.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2017-05-03 11:30:58 +02:00
aszlig
79f3e94131
player: Give a visual cue about loading state
If the player doesn't work correctly (which currently is the case on my
system) or can't load the file immediately (like for example from a
network resource) it's a good idea to actually show in the tile that
it's still trying to load the source.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2017-05-03 11:30:55 +02:00
aszlig
d891d9adb2
Add a default.nix for development/building for Nix
This is mainly so that you could easily have a nix-shell with the
dependencies set up and also a way to build a package out of it.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2017-05-03 11:30:52 +02:00
Oscar Cerna-Mandujano
3a68d4436b Merge pull request #2 from JupiterBroadcasting/master
Adding Google C++ Style Guide
2017-05-02 16:40:02 -07:00
aszlig
171b5debb7
qmake: Add an install target
This adds an "install" target to the resulting Makefile, so it's easier
to be packaged for distributions.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2017-05-03 01:07:19 +02:00
rikai
1eb9124725 Merge pull request #1 from GDog1985/master
Rename mainwindow.h to MainWindow.h
2017-05-02 10:46:28 -07:00
Greg
52a92a3e21 Rename mainwindow.h to MainWindow.h 2017-05-02 04:43:40 -04:00
Oscar Cerna
ad92a02670 updated read me 2015-09-05 00:31:58 -07:00
Oscar Cerna
606addb10e Updated read me file 2015-09-05 00:24:43 -07:00
Oscar Cerna
1d66a9b29d initial code
second commit, but is the first commit with actual code.
2015-09-05 00:22:12 -07:00
Oscar Cerna
293216813a Initial commit 2013-07-20 12:07:25 -07:00