Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build/
*~
Binary file added data/icons/play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/play_active.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/record.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/record_active.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/record_disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/stop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/stop_active.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/icons/stop_disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,19 @@ i18n.merge_file(
)

install_data (
join_paths('icons', 'play.png'),
install_dir: join_paths('share', 'abbysoft-team', 'compose', 'icons')
)
install_data (
join_paths('icons', 'stop.png'),
install_dir: join_paths('share', 'abbysoft-team', 'compose', 'icons')
)
install_data (
join_paths('icons', 'record.png'),
install_dir: join_paths('share', 'abbysoft-team', 'compose', 'icons')
)

install_data (
join_paths('css', 'main.css'),
install_dir: join_paths('share', 'abbysoft-team', 'temperature', 'css')
install_dir: join_paths('share', 'abbysoft-team', 'compose', 'css')
)
2 changes: 2 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ dependencies = [
dependency('libpulse-mainloop-glib'),
dependency('sndfile'),
dependency('jack'),
dependency('gl'),
dependency('glew'),
math_dep

]
Expand Down
2 changes: 0 additions & 2 deletions meson/post_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@
subprocess.call(['update-desktop-database', '-q', desktop_database_dir])
print('Updating icon cache…')
subprocess.call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')])
print('Installing lm-sensors if not exist')
subprocess.call(['sudo', 'apt-get', 'install', 'lm-sensors'])
116 changes: 58 additions & 58 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -20,111 +20,117 @@
*/
public class Application : Gtk.Application {

private AudioInterface backend;
private Controller controller;
private AudioContext context;
private WorkingArea working_area;

Application (AudioInterface backend) {
Application () {
Object (
application_id: "com.github.abbysoft-team.compose",
flags: ApplicationFlags.FLAGS_NONE
);

this.backend = backend;
}

~Application () {
backend.close();

}


protected override void activate () {
// initialize backend
var context = new AudioContext ();
var backend = context.get_audio_interface ();
if (backend.init () != 0) {
stderr.printf ("failed to initialize backend\n");
Process.exit (1);
}

controller = new Controller (backend);
controller.init ();

working_area = new WorkingArea (controller);

controller.working_area = working_area;

var main_window = create_main_window ();

var content_container = new Gtk.Grid () {
orientation = Gtk.Orientation.HORIZONTAL
};

content_container.add (create_controls_panel ());

content_container.add (create_controls_panel (working_area.tracks));
content_container.add (create_working_area());

main_window.add (content_container);

main_window.show_all ();
}

private Gtk.Window create_main_window () {
private Gtk.ApplicationWindow create_main_window () {
var main_window = new Gtk.ApplicationWindow (this);
main_window.title = _("Compose");

main_window.default_width = 1111;
main_window.default_height = 777;

main_window.set_titlebar (create_title_bar ());


//Granite.Widgets.Utils.set_color_primary (main_window, {222, 22, 0, 256});
//Granite.Widgets.Utils.set_color_primary (main_window, {0.8, 0.8, 0.8, 1});

return main_window;
}

private Gtk.Grid create_controls_panel () {
var container = new Gtk.Grid () {
orientation = Gtk.Orientation.VERTICAL
};
private Gtk.HeaderBar create_title_bar () {
var header_bar = new Gtk.HeaderBar ();

container.add (create_track_controls ());
container.add (create_track_controls ());
container.add (create_track_controls ());

return container;
}

private Gtk.Box create_track_controls () {
var container = new Gtk.Box (HORIZONTAL, 5);
header_bar.set_show_close_button (true);
header_bar.title = _("Untitled");
header_bar.has_subtitle = false;

container.add (create_record_button ());
container.add (new Gtk.Button.with_label (_("Play")));
container.add (new Gtk.Button.with_label (_("Stop")));
var transport_controls = new TransportWidget (controller);

container.vexpand = true;
header_bar.pack_start (new Gtk.Button.with_label (_("New")));
header_bar.pack_start (new Gtk.Button.with_label (_("Open")));
header_bar.pack_start (new Gtk.Button.with_label (_("Save")));
header_bar.pack_start (new Gtk.Label (_(" ")));
header_bar.pack_start (transport_controls);

return container;
return header_bar;
}

private Gtk.Button create_record_button () {
Gtk.Button button = new Gtk.Button.with_label (_("Record"));
button.clicked.connect (() => {
backend.record ();
print ("recording... \n");
});

return button;
private Track[] create_tracks (int count) {
var tracks = new Track[count];

return tracks;
}

private Gtk.Box create_working_area () {
var container = new Gtk.Box (VERTICAL, 5);
private Gtk.Grid create_controls_panel (Track[] tracks) {
var container = new Gtk.Grid () {
orientation = Gtk.Orientation.VERTICAL
};

container.add (create_track_body ());
container.add (create_track_body ());
container.add (create_track_body ());
var visible_tracks = 3;

for (int i = 0; i < visible_tracks; i++) {
container.add (tracks[i].controls_widget);
}

container.vexpand = true;
container.hexpand = true;

return container;
}

private Gtk.Box create_track_body () {
private Gtk.Box create_working_area () {
var container = new Gtk.Box (VERTICAL, 5);

var label = new Gtk.Label (_("start recording"));
label.justify = Gtk.Justification.CENTER;
label.get_style_context ().add_class (Granite.STYLE_CLASS_H1_LABEL);
working_area.hexpand = true;
working_area.vexpand = true;

container.valign = Gtk.Align.CENTER;

container.add (label);
container.add (working_area);

container.hexpand = true;
container.vexpand = true;

container.hexpand = true;

return container;
}

Expand All @@ -133,14 +139,8 @@ public class Application : Gtk.Application {
stderr.printf ("Cannot run without thread support.\n");
return 1;
}

var backend = new JackAudioInterfaceImpl ();
if (backend.init () != 0) {
stderr.printf ("failed to initialize backend\n");
return 1;
}

var app = new Application (backend);
var app = new Application ();

return app.run (args);
}
Expand Down
148 changes: 0 additions & 148 deletions src/Application.vala~

This file was deleted.

1 change: 1 addition & 0 deletions src/Exporter.vala
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
public interface Exporter : GLib.Object {
public abstract int export_wav (float *buffer, size_t size, string file_name);
public abstract int export_audio_wav (AudioData data, string file_name);
}
3 changes: 0 additions & 3 deletions src/Exporter.vala~

This file was deleted.

Loading