summaryrefslogtreecommitdiff
path: root/bass_player.rb
diff options
context:
space:
mode:
authorMatias Linares <matias.linares@comprandoengrupo.net>2022-06-24 09:37:33 -0300
committerMatias Linares <matias.linares@comprandoengrupo.net>2022-06-24 09:37:33 -0300
commitb0d2b24c6f552b5a54b0f3c3c2b00d596a5ad9c1 (patch)
treebb1a45adc32956e3174024db0f69ad0b7b977c5a /bass_player.rb
parent51510f09b4bcaf21f75c3133aa6ecbe97c8139b8 (diff)
downloadbass-player-b0d2b24c6f552b5a54b0f3c3c2b00d596a5ad9c1.tar.gz
Change model Part to Segment
Diffstat (limited to 'bass_player.rb')
-rw-r--r--bass_player.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/bass_player.rb b/bass_player.rb
index 6cb73c4..b625523 100644
--- a/bass_player.rb
+++ b/bass_player.rb
@@ -12,7 +12,7 @@ module BassPlayer
property(:duration) { '' }
property(:current_song) { 0 }
property(:model) { QML::ArrayModel.new(:title, :duration) }
- property(:part_model) {
+ property(:segment_model) {
QML::ArrayModel.new(:name, :from, :to)
}
@@ -54,23 +54,23 @@ module BassPlayer
self.current_song = model[song][:title]
puts "Setting current song to #{self.current_song}"
end
- part_model.clear
- parts = Song.first(title: self.current_song).parts.map do |part|
+ segment_model.clear
+ segments = Song.first(title: self.current_song).segments.map do |segment|
{
- name: part.name,
- from: ms_to_time(part.from),
- to: ms_to_time(part.to)
+ name: segment.name,
+ from: ms_to_time(segment.from),
+ to: ms_to_time(segment.to)
}
end
- for part in parts
- part_model << part
+ for segment in segments
+ segment_model << segment
end
end
def add_segment(name, from, to)
song = Song.first(title: current_song)
- Part.create(
+ Segment.create(
name: name, from: from, to: to,
song_id: song.id
)