summaryrefslogtreecommitdiff
path: root/Applications/Piano
AgeCommit message (Collapse)Author
2021-01-04Everywhere: Use GUI::CommonActions::make_about_action()Andreas Kling
2020-12-31Piano: Quit the audio thread by checking Core::EventLoop for exitAndrew Kaster
The infinite loop here doesn't really work at all for an application process that expects to be able to exit. Check against Core::EventLoop::current() to see if it's time to exit, and return 0 from the thread function if so. The thread will be joined in its destructor, which doesn't assert anymore now that Thread is a jthread.
2020-12-31LibThread: Hide Thread's constructor, as it is a Core::ObjectAndrew Kaster
Just constructing one of these guys on the stack willy nilly will leak the first reference to them. There might be other C_OBJECTs that have public constructors, seems like a good place for some static analysis checks :). Force users to call the construct() method for it.
2020-12-30LibGFX: Move default_xxx_font() methods from Font to FontDatabaseStephan Unverwerth
When we have an abstract font class it makes no sense to keep these methods in the Font class.
2020-12-30LibGUI: Rename AbstractSlider::on_value_changed => on_changeAndreas Kling
This matches other similar hook names.
2020-12-30LibGUI: Rewrite layout system in terms of min and max sizesAndreas Kling
This patch removes size policies and preferred sizes, and replaces them with min-size and max-size for each widget. Box layout now works in 3 passes: 1) Set all items (widgets/spacers) to their min-size 2) Distribute remaining space evenly, respecting max-size 3) Place widgets one after the other, adding spacing in between I've also added convenience helpers for setting a fixed size (which is the same as setting min-size and max-size to the same value.) This significantly reduces the verbosity of widget layout and makes GML a bit more pleasant to write, too. :^)
2020-12-25Everywhere: Tweak "2020-2020" => "2020" in copyright headersAndreas Kling
2020-12-21Build: Embed application icons directly in the executables.William Marlow
New serenity_app() targets can be defined which allows application icons to be emedded directly into the executable. The embedded icons will then be used when creating an icon for that file in LibGUI.
2020-12-21Everywhere: Switch from (void) to [[maybe_unused]] (#4473)Lenny Maiorani
Problem: - `(void)` simply casts the expression to void. This is understood to indicate that it is ignored, but this is really a compiler trick to get the compiler to not generate a warning. Solution: - Use the `[[maybe_unused]]` attribute to indicate the value is unused. Note: - Functions taking a `(void)` argument list have also been changed to `()` because this is not needed and shows up in the same grep command.
2020-12-02Applications+Userland: Switch to new Audio::Loader APIJulian Offenhäuser
2020-11-02Applications: Use pledge and unveilBrendan Coles
2020-11-02Applications: Use GUI::Icon::default_icon to set application iconBrendan Coles
2020-10-30LibGUI: Add Widget focus policiesAndreas Kling
Every widget now has a GUI::FocusPolicy that determines how it can receive focus: - NoFocus: The widget is not focusable (default) - TabFocus: The widget can be focused using the tab key. - ClickFocus: The widget can be focused by clicking on it. - StrongFocus: Both of the above. For widgets that have a focus proxy, getting/setting the focus policy will affect the proxy instead.
2020-10-12Piano: Add UI support for different lengths of notesPeter Elliott
2020-10-12Piano: Add note names to RollWidgetPeter Elliott
2020-10-12Piano: Highlight pressed key in roll widgetPeter Elliott
2020-10-06Piano: Use new format functions.asynts
2020-09-08Refactor: Replace usages of FixedArray with Array.asynts
2020-08-27Meta: Force semi-colon after MAKE_AK_NONXXXABLE()Ben Wiederhake
Before, we had about these occurrence counts: COPY: 13 without, 33 with MOVE: 12 without, 28 with Clearly, 'with' was the preferred way. However, this introduced double-semicolons all over the place, and caused some warnings to trigger. This patch *forces* the usage of a semi-colon when calling the macro, by removing the semi-colon within the macro. (And thus also gets rid of the double-semicolon.)
2020-08-17Piano: Uninitialized member variables in RollWidet, found by CoverityBrian Gianforcaro
This seem like they wouldn't cause any problems in reality, but it's nice to fix them to avoid any future misuse.
2020-08-01Applications: Stop setting initial window locationPeter Elliott
This will let the WindowManager choose the location of the window
2020-07-16LibWeb: Require parent window argument for MessageBoxTom
Since the vast majority of message boxes should be modal, require the parent window to be passed in, which can be nullptr for the rare case that they don't. By it being the first argument, the default arguments also don't need to be explicitly stated in most cases, and it encourages passing in a parent window handle. Fix up several message boxes that should have been modal.
2020-07-16LibGUI: Add parent window argument to FilePicker functionsTom
Since FilePicker almost always should be modal, add the parent window as mandatory first argument.
2020-07-11Piano: Fix cliping of bottom notes when scrolling in RollWidgetPeter Elliott
fixes #2577
2020-07-11Piano: Handle octave slider jumps of greater than 1Peter Elliott
The previous slider handler relied on the new value being 1 different than the previous. fixes #1163.
2020-07-07Piano: Make menu bar consistent with other appsNico Weber
"Help" should be after "Edit". The "Quit" menu item should be at the end of the app menu, and after a separator.
2020-07-04LibGUI: Turn GUI::Application::the() into a pointerAndreas Kling
During app teardown, the Application object may be destroyed before something else, and so having Application::the() return a reference was obscuring the truth about its lifetime. This patch makes the API more honest by returning a pointer. While this makes call sites look a bit more sketchy, do note that the global Application pointer only becomes null during app teardown.
2020-07-04LibGUI: Make GUI::Application a Core::ObjectAndreas Kling
Having this on the stack makes whole-program teardown iffy. Turning it into a Core::Object allows anyone who needs it to extends its lifetime.
2020-06-18Piano: Expose multi-track functionalityWilliam McPherson
This commit adds some actions for creating and cycling through tracks. set_octave_and_ensure_note_change() was refactored to allow switching tracks to implement the same behaviour. KnobsWidget is getting pretty bad.
2020-06-18Piano: Allow multiple tracks internallyWilliam McPherson
This commit adds multi-track functionality without exposing it to the user. All I really did was rename AudioEngine to Track and allow more than one Track in TrackManager. A lot of the changes are just changing widgets to take a TrackManager and use current_track(). The TrackManager creates Tracks and gives them a read-only reference to the global time value. When the TrackManager wants to fill a sample in the buffer (in fill_buffer()), it calls fill_sample() on each Track. The delay code is slightly different - a Track will fill its m_delay_buffer with the sample it just created rather than the most recent sample in the buffer (which used to be the same thing). TrackManager manages the current octave. Other than those few things, this is a pretty basic separation of concerns.
2020-06-10LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSizeAndreas Kling
This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much better visual clue about what type of metric is being used.
2020-05-14Build: Switch to CMake :^)Sergey Bugaev
Closes https://github.com/SerenityOS/serenity/issues/2080
2020-05-12LibGUI: Include keyboard modifier state with button on_click callsAndreas Kling
This will allow you us to implement special behavior when Ctrl+clicking a button.
2020-04-21LibGUI: Make MenuBar a Core::ObjectAndreas Kling
This makes it show up in Inspector with all the menus inside it. :^)
2020-04-15Piano: Use NumericLimits<T>Andreas Kling
2020-04-04LibGUI: Add MenuBar::add_menu(name)Andreas Kling
This allows us to construct menus in a more natural way: auto& file_menu = menubar->add_menu("File"); file_menu.add_action(...); Instead of the old way: auto file_menu = GUI::Menu::construct(); file_menu->add_action(...); menubar->add_menu(file_menu);
2020-03-19Applications: Remove G prefixes from commentsTibor Nagy
2020-03-04LibGUI: Use GUI::Window::set_main_widget<WidgetType>() in clientsAndreas Kling
2020-03-04LibGUI: Use set_layout<LayoutType>() in lots of client codeAndreas Kling
2020-03-03LibGUI: Remove Button& parameter from Button::on_click hookAndreas Kling
There was but a single user of this parameter and it's a bit tedious to write it out every time, so let's get rid of it.
2020-02-27Piano: New timing system and zoomable piano rollWilliam McPherson
This patch allows roll notes to be of different sizes. This necessitates a new internal representation of time. BPM and time signatures are mostly implemented but not exposed. Roll notes are now sample-accurate and the grid is aligned to 60 BPM 4/4. The roll is divided by the time signature raised to some power of 2, giving the musical divisions of (in the case of 4/4) 16, 32, 64 etc. Before, our timing was derived from the buffer size and we relied on that to implement delay. Delay has been rewritten to be sample-granular. It's now exposed as the proper "divisions of a beat". Something to be wary of is that the last buffer in the loop is also used for the start of the next loop. In other words, we loop mid-buffer. This means we write WAVs with a tiny bit of silence due to breaking the loop after filling half a buffer. The data structure for the roll is an array of SinglyLinkedLists of RollNotes. Separating by pitch (via the array layout) makes insertion much simpler and faster. Using sorted lists (and thus SinglyLinkedListIterators) to do lookups is very quick as you know the sample of the next note and can just compare it to the current sample. I implemented this with HashMaps and the cost of lookups was abysmal. I also tried a single SinglyLinkedList and the insertion code got even more complicated than it already is.
2020-02-25AK: Make Queue use size_t for its sizeAndreas Kling
2020-02-25AK: Make Vector use size_t for its size and capacityAndreas Kling
2020-02-23LibGUI: Add helper for constructing new TabWidget tabsAndreas Kling
This patch adds the following convenience helper: auto tab_widget = GUI::TabWidget::construct(); auto my_widget = tab_widget->add_tab<GUI::Widget>("My tab", ...); The above is equivalent to: auto tab_widget = GUI::TabWidget::construct(); auto my_widget = GUI::Widget::construct(...); tab_widget->add_widget("My tab", my_widget);
2020-02-23LibGUI: Make GUI::Frame have the 2px sunken container look by defaultAndreas Kling
The overwhelming majority of GUI::Frame users set the same appearance, so let's just make it the default.
2020-02-23Userspace: Use Core::Object::add() when building interfacesAndreas Kling
2020-02-16Piano: Set step property for ADSR slidersTibor Nagy
2020-02-16LibGUI: Add forwarding headerAndreas Kling
This patch adds <LibGUI/Forward.h> and uses it a bunch. It also dragged various header dependency reduction changes into it.
2020-02-15LibGUI: Reduce menu-related header dependenciesAndreas Kling
2020-02-10LibAudio/Piano: Replace floats with doublesWilliam McPherson
We should default to double-precision so that clients can make the choice to use float or double.