module MultimediaParadise::GUI::Gtk::VideoEditorModule

Constants

HEIGHT
#

HEIGHT

#
NAMESPACE
#

NAMESPACE

#
TITLE
#

TITLE

#
WIDTH
#

WIDTH

#

Public Class Methods

new( commandline_arguments = ARGV, run_already = true ) click to toggle source
#

initialize

#
Calls superclass method
# File lib/multimedia_paradise/gui/shared_code/video_editor/video_editor_module.rb, line 47
def initialize(
    commandline_arguments = ARGV,
    run_already           = true
  )
  super(:vertical)
  reset
  set_commandline_arguments(
    commandline_arguments
  )
  run if run_already
end
run( i = ARGV ) click to toggle source
#

MultimediaParadise::GUI::Gtk::VideoEditorModule.run

#
# File lib/multimedia_paradise/gui/shared_code/video_editor/video_editor_module.rb, line 202
def self.run(
    i = ARGV
  )
  require 'gtk_paradise/run'
  _ = ::MultimediaParadise::GUI::Gtk::VideoEditor.new(i)
  r = ::Gtk.run
  r << _
  r.set_size_request(_.width?, _.height?)
  r.title_from_child_widget
  r.top_left_then_run
end

Public Instance Methods

add_the_hbox_where_the_user_specifies_with_which_file_to_work() click to toggle source
#

add_the_hbox_where_the_user_specifies_with_which_file_to_work

#
# File lib/multimedia_paradise/gui/shared_code/video_editor/video_editor_module.rb, line 171
def add_the_hbox_where_the_user_specifies_with_which_file_to_work
  hbox = gtk_hbox
  hbox.minimal(
    gtk_label('Work on this file: '), 2
  )
  hbox.maximal(@entry_work_on_this_file, 2)
  hbox.minimal(button_open_file?,        4)
  minimal(hbox)
end
add_useful_buttons() click to toggle source
#

add_useful_buttons (buttons tag, button tag)

#
# File lib/multimedia_paradise/gui/shared_code/video_editor/video_editor_module.rb, line 138
def add_useful_buttons
  @button_remove_audio.on_clicked {
    Thread.new {
      result = MultimediaParadise.remove_audio(@entry_work_on_this_file.text?) { :always_overwrite_existing_files }
      @text_buffer.set_text('Stored at: '+result.to_s)
    }
  }
  hbox = gtk_hbox
  hbox.minimal(@button_remove_audio, 2)
  @button_extract_audio.on_clicked {
    Thread.new {
      result = MultimediaParadise.extract_audio(@entry_work_on_this_file.text?) { :always_overwrite_existing_files }
      @text_buffer.set_text('Stored at: '+result.to_s)
    }
  }
  hbox.minimal(@button_extract_audio, 2)
  hbox.set_size_request(280, 70)
  minimal(hbox, 5)
  maximal(@scrolled_window, 5)
end
border_size?() click to toggle source
#

border_size?

#
# File lib/multimedia_paradise/gui/shared_code/video_editor/video_editor_module.rb, line 96
def border_size?
  2
end
button_open_file?() click to toggle source
#

button_open_file?

#
# File lib/multimedia_paradise/gui/shared_code/video_editor/video_editor_module.rb, line 249
def button_open_file?
  @button_open_file
end
connect_skeleton() click to toggle source
#

connect_skeleton (connect tag)

#
# File lib/multimedia_paradise/gui/shared_code/video_editor/video_editor_module.rb, line 162
def connect_skeleton
  abort_on_exception
  add_the_hbox_where_the_user_specifies_with_which_file_to_work
  add_useful_buttons
end
create_skeleton() click to toggle source
#

create_skeleton (create tag)

#
# File lib/multimedia_paradise/gui/shared_code/video_editor/video_editor_module.rb, line 116
def create_skeleton
  create_the_entries # Must come before create_the_buttons().
  create_the_buttons
  @text_buffer = gtk_text_buffer
  @text_view   = gtk_text_view(@text_buffer)
  @text_view.set_border_width(2)
  @text_view.css_class('pad2px')
  @scrolled_window = gtk_scrolled_window(@text_view) { :always }
  @scrolled_window.set_size_request(500, 300)
  @scrolled_window.bblack2
end
create_the_buttons() click to toggle source
#

create_the_buttons (buttons tag)

#
# File lib/multimedia_paradise/gui/shared_code/video_editor/video_editor_module.rb, line 256
def create_the_buttons
  # ======================================================================= #
  # === @button_open_file
  # ======================================================================= #
  @button_open_file = gtk_button('_Open file')
  @button_open_file.bblack1
  @button_open_file.enable_markup
  @button_open_file.hint = 'This button can be used open a local file.'
  @button_open_file.on_clicked {
    do_open_a_local_file
  }
  # ======================================================================= #
  # === @button_extract_audio
  # ======================================================================= #
  @button_extract_audio = gtk_button('Extract Audio')
  @button_extract_audio.bblack2
  @button_extract_audio.hint = 'This button can be used to '\
    'extract the audio from the file at hand.'
  # ======================================================================= #
  # === @button_remove_audio
  # ======================================================================= #
  @button_remove_audio = gtk_button('Remove Audio')
  @button_remove_audio.bblack2
  @button_remove_audio.hint = 'Click this button '\
    'to remove the audio from the designated main '\
    'file (at <b>'+file?+'</b>). Note that this will '\
    'overwrite any existing local file, so only click '\
    'this if you are absolutely certain that you want '\
    'this functionality.'
end
create_the_entries() click to toggle source
#

create_the_entries

#
# File lib/multimedia_paradise/gui/shared_code/video_editor/video_editor_module.rb, line 103
def create_the_entries
  # ======================================================================= #
  # === @entry_work_on_this_file
  # ======================================================================= #
  @entry_work_on_this_file = gtk_entry
  @entry_work_on_this_file.set_text('/Depot/j/foobar.mp4')
  @entry_work_on_this_file.yellow_background
  @entry_work_on_this_file.bblack1
end
do_focus_on_the_input_field() click to toggle source
#

do_focus_on_the_input_field

#
# File lib/multimedia_paradise/gui/shared_code/video_editor/video_editor_module.rb, line 192
def do_focus_on_the_input_field
  Thread.new {
    sleep 0.0001
    @text_view.do_focus
  }
end
do_open_a_local_file() click to toggle source
#

do_open_a_local_file

#
# File lib/multimedia_paradise/gui/shared_code/video_editor/video_editor_module.rb, line 217
def do_open_a_local_file
  _ = open_local_file # Find a local file. (open tag)
  if File.exist?(_) and File.file?(_)
    set_main_entry(_)
  end
end
file?()
Alias for: which_file?
open_local_file() click to toggle source
#

open_local_file

#
# File lib/multimedia_paradise/gui/shared_code/video_editor/video_editor_module.rb, line 227
def open_local_file
  require 'gtk_paradise/widgets/gtk3/select_file/select_file.rb'
  # ======================================================================= #
  # We will actively filter for .mp3 files only.
  # ======================================================================= #
  widget = ::Gtk::SelectFile.new(self) {{
    current_folder:  '/home/x/songs/'
  }}
  this_file = widget.do_pick_file.text.to_s
  return this_file
end
padding?() click to toggle source
#

padding?

#
# File lib/multimedia_paradise/gui/shared_code/video_editor/video_editor_module.rb, line 89
def padding?
  2
end
reset() click to toggle source
#

reset (reset tag)

#
# File lib/multimedia_paradise/gui/shared_code/video_editor/video_editor_module.rb, line 62
def reset
  reset_the_internal_variables
  # ======================================================================= #
  # === @configuration
  # ======================================================================= #
  @configuration = [true, __dir__, NAMESPACE]
  # ======================================================================= #
  # === @title
  # ======================================================================= #
  @title  = TITLE
  # ======================================================================= #
  # === @width
  # ======================================================================= #
  set_width(WIDTH)
  # ======================================================================= #
  # === @height
  # ======================================================================= #
  set_height(HEIGHT)
  cd('/Depot/j/') if is_on_roebe?
  set_use_this_font(:dejavu_condensed_20)
  use_gtk_paradise_project_css_file
  infer_the_size_automatically
end
run() click to toggle source
#

run (run tag)

#
# File lib/multimedia_paradise/gui/shared_code/video_editor/video_editor_module.rb, line 184
def run
  create_skeleton_then_connect_skeleton
  do_focus_on_the_input_field
end
set_main_entry(i) click to toggle source
#

set_main_entry

#
# File lib/multimedia_paradise/gui/shared_code/video_editor/video_editor_module.rb, line 242
def set_main_entry(i)
  @entry_work_on_this_file.set_text(i.to_s)
end
which_file?() click to toggle source
#

which_file?

#
# File lib/multimedia_paradise/gui/shared_code/video_editor/video_editor_module.rb, line 131
def which_file?
  @entry_work_on_this_file.text?.to_s
end
Also aliased as: file?