Commit Graph

532 Commits

Author SHA1 Message Date
casey
f94633c671 - Fixed bugs where initial output volume was set incorrectly in player,
causing a volume jump when switching tracks.
- Modified Transport to initialize and share an output device between
  all Player instances it manages.
2016-05-24 20:56:44 -07:00
casey
05aca20bbd - Fixed a memory leak in Mp3Decoder
- Fixed WaveOut::Stop() to only reset the output device, not close it,
  to prevent cracking while seeking and also get us a step closer to
  gapless playback.
- Fixed GlobalHotkey handling so key presses aren't propagated to the
  focused control after they're handled
- Removed old, unused state from SimpleScrollAdapter
- Fixed crash on exit when using the "X" button by registering a custom
  close handler with PDCurses.
2016-05-24 20:31:43 -07:00
casey
14aa38518a Added global hotkeys for scrubbing 2016-05-24 00:10:36 -07:00
casey
54192079ed Fixed a couple bugs that prevented auto-advancing from working properly. 2016-05-24 00:00:26 -07:00
casey
6326162ee0 Added support for Play/Prev/Next/Stop in Playback service and respective
global hotkeys. It functions as a normal music player, finally!
2016-05-23 23:51:49 -07:00
casey
b544ea6f1f Important work towards eventual support of gapless playback:
- Transport: cleaned up memory management model -- shared_ptr<Player>
  was causing lots of unnecessary complication. The players are
  encapsulated, so switched to just Player*

- Player's destructor wasn't virtual! Caused some strange problems.

- Integrated next track loading in PlayerService!
2016-05-23 22:33:40 -07:00
casey
65a4d33823 Track::URL -> Track::URI 2016-05-22 11:09:18 -07:00
casey
26311255b5 Generalization of message queue stuff so it can be used in non-UI
contexts:

- IWindowMessage -> IMessage
- New IMessageTarget implemented by IWindow
- WindowMessageQueue -> MessageQueue
2016-05-22 10:14:01 -07:00
casey
4f7a6ea7e2 More core cleanup:
- Removed TrackFactory, InMemoryTrack
- Tightened up threading model in LibraryTrack
- Removed a bunch of comments that were not really useful
- Added stubbed PlaybackService
2016-05-22 09:55:17 -07:00
casey
34e2ff1751 Fixed some character encoding issues in file loading and track list
column rendering.
2016-05-22 01:01:47 -07:00
casey
bb1bc9c822 * Improvements to the transport look and feel, including blinking time
while paused, and space to pause/resume
* Better keynames for Track album/artist/genre (don't reuse ID keys)
* No flashing when switching between metadata category types
2016-05-22 00:05:41 -07:00
casey
191445d74f Fixed a bug where missing files were not being removed from the library.
I think this is desired behavior.
2016-05-21 00:27:29 -07:00
casey
174d00b4d5 A couple small hotkey shortcuts for refreshing the view, and
re-indexing.
2016-05-21 00:06:48 -07:00
casey
af60dedb4b Added first-class support for album artist. 2016-05-21 00:00:58 -07:00
casey
6d025cdad1 - Added ILayoutStack, IOrderable, LayoutStack, and WindowLayout. These
new types make it possible for layouts to be stacked on top of each
  other with correct focus behavior.

- Tweaks to the volume and time slider to make them more accurate.

- Fixed a bug in the main event loop to re-check focus to make sure it
  hasn't changed under the hood since the last pass through.
2016-05-19 22:32:26 -07:00
casey
094cb358fe - Renamed Window::Post -> Window::PostMessage
- Added Window::RemoveMessage
- Fixed TransportWindow to have a time slider that actually works.
2016-05-18 22:36:20 -07:00
casey
0ece15710e - Added duration to TrackListView, and also tweaked some formatting
- Updated transport volume control style
- Cleaned up and rearranged some input handling so we can better support
  nested layouts in the future
- Tweaked Window to use panels so draw ordering can be vaguely
  controlled, at least as well as vanilla ncurses
- Started working on overlay functionality, so layouts can do things
  like display dialogs.
2016-05-18 21:33:17 -07:00
casey
1d2541e100 Much improved console UI with global hotkeys and some column formatting 2016-05-18 02:29:11 -07:00
casey
e8b9c873db Added new NO_SELECTION constant to ListWindow, and use it to help set and reset default state. 2016-05-17 22:57:18 -07:00
casey
2d65ab480a - Cleaned up and generalized Transport event handling
- Added some virtual destructors to interfaces
2016-05-17 22:45:32 -07:00
casey
483760effd Fixed bugs related to updating the transport. Removed weird sort_order1 column. No longer poll TransportWindow for updates -- react to events. 2016-05-17 19:32:45 -07:00
casey
072aa94bc5 Moved up/down/pageup/pagedown/home/end key handling into
ScrollableWindow and out of the main loop.
2016-05-16 23:02:19 -07:00
casey
04a4c33ae0 Re-pathed app portion of musikbox source files to be better organized. 2016-05-16 22:32:05 -07:00
casey
f073e6cb74 Moved all generic curses-related abstractions to a "cursespp"
subdirectory.
2016-05-16 22:23:25 -07:00
casey
fc86bacaaf - Killed a bunch of really unnecessary, complicated path management
logic in the Indexer.
- Created a new IKeyHandler for windows that want to receive keyboard
  events but aren't necessarily input fields.
- Added some hacked up code to get playback working in the
  TrackListView. This functionality will be extracted to LibraryLayout
  in the near future.
2016-05-16 22:00:45 -07:00
casey
1c13ac278d Added LocalLibraryConstants.h 2016-05-16 18:38:03 -07:00
casey
60cdbdded8 Functional TrackListViewQuery! We can actually see selected tracks for albums now. 2016-05-16 16:27:12 -07:00
casey
c259e911db Added a "SelectionChanged" event to ListWindow 2016-05-16 09:51:57 -07:00
casey
d1f2d867f5 A couple small bug fixes related to the new message queue interaction. 2016-05-15 21:28:06 -07:00
casey
2353f827eb Removed remaining "OnIdle" callback junk and replaced with the new
immediate, message-driven functionality.
2016-05-15 20:54:55 -07:00
casey
06ff327ff2 - Working WindowMessageQueue implementation
- TransportWindow is now self-updating via messages posted at a regular
  interval; no longer relies on the idle loop.
2016-05-15 17:13:00 -07:00
casey
6bc828775d More implementation of MessageQueue. Interfaces and names are going to need to change. 2016-05-15 16:43:44 -07:00
casey
132bc25d43 - Fixed Window to no longer use derwin() -- subwindows share data with
their parent, in a sometimes buggy and unpredictable ways. always use
  newwin() and ensure redraws happen from the bottom up.

- Optimized redraw to not immediately call doupdate(), but rather wait
  until the end of the runloop and call it once. This may cause buggy
  behavior, but seems fine now...
2016-05-15 12:18:29 -07:00
casey
1a0d297b30 - Renamed MetadataValue -> MetadataKeyValue
- Cleaned up some of the requery logic in CategoryListView,
  TrackListView
- Started working on the message-queue related functionality that will
  be required for clean callback logic
- Reduced the main loop timeout delay
2016-05-15 11:14:43 -07:00
casey
45e8cf956e Fixed focus problems in top-level layout management, and also fixed a bug in CommandWindow where it wasn't re-shown properly. 2016-05-14 22:10:24 -07:00
casey
4eabea9f20 Fixed UTF8 decoding in TaglibMetadataReader. Oops. 2016-05-14 21:55:44 -07:00
casey
2aef8ee6a4 Updated Layout focus semantics, and fixed sort order re-indexing in
LayoutBase
2016-05-14 19:15:58 -07:00
casey
95d8e8ab42 - Initial crack at generalizing focus in LayoutBase
- Renamed Create -> Show, Destroy -> Hide
- Added IDisplayable interface for Layouts and Windows
- A couple other small fixes.
2016-05-14 15:07:23 -07:00
casey
f6fcdaaab0 Functional top-level windows. Finally. 2016-05-14 02:35:34 -07:00
casey
47fffa7f73 boost::shared_ptr -> std::shared_ptr, boost::weak_ptr -> std::weak_ptr 2016-05-14 01:16:50 -07:00
casey
dd29f1e500 Added IWindowGroup, which is extended by ILayout and implemented by
LayoutBase. Recursive create/destroy working.
2016-05-14 01:11:03 -07:00
casey
17b56ddbab A couple minor changes to make screen updates more efficient. 2016-05-13 23:00:32 -07:00
casey
7016c2aac2 Added the ability for views to have real parent views. Added LayoutBase,
which is a subclass of Window, and now acts as a parent.
2016-05-13 21:52:30 -07:00
casey
d11c4fc425 Introduction of ListWindow, a special type of ScrollableWindow that
tracks a user selected row and has slightly different scrolling
behaviors.
2016-05-13 00:25:12 -07:00
casey
66c19c2123 More improvements to layouts and stuff. Need to figure out scroll focus
situation soon.
2016-05-12 02:31:44 -07:00
casey
2de2a21291 Much improved ScrollableWindow and Adapter interfaces which allow for
virtual lists with extremely large item counts.
2016-05-12 00:16:58 -07:00
casey
c179878e80 Boring, necessary refactors to support more dynamic lists of content. 2016-05-11 01:15:24 -07:00
casey
b718691553 Fixed a bug where ScrollableWindow wasn't properly notifying the adapter
of the display dimensions.
2016-05-10 21:25:16 -07:00
casey
c4111850fe - Consolidated LibraryBase, LocalLibrary. introduced ILibrary interface
- Added IIndexer interface for ILibrary
- Fixed and simplified LocalLibrary and Indexer startup behavior
- Added IQuery interface, fixed QueryBase
- Fixed LocalLibrary.enqueue() to work properly with new IQuery
  interface
- Introduced ILayout interface and MainLayout implementation
2016-05-10 20:47:30 -07:00
casey
adb0ed14b1 With a heavy heart, I've decided to retire most of the current
implementation of Library and QueryBase. There is just too much buggy
and difficult to follow synchronization logic built in.
2016-05-09 22:47:24 -07:00