-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.rb
More file actions
executable file
·71 lines (55 loc) · 1.83 KB
/
demo.rb
File metadata and controls
executable file
·71 lines (55 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env ruby
# Visual demo of the Ongaku player
# Shows the interface without needing to play real music
require 'tty-prompt'
require 'tty-box'
require 'pastel'
require_relative 'lib/demo_mode'
pastel = Pastel.new
prompt = TTY::Prompt.new
# Banner
system('clear')
banner = TTY::Box.frame(
pastel.cyan.bold("🎵 ONGAKU PLAYER - DEMO 🎵"),
padding: 1,
align: :center
)
puts banner
puts pastel.dim("YouTube player for terminal\n")
puts pastel.yellow("Mode: DEMO (using sample songs)\n\n")
# Show list of available songs
puts pastel.green.bold("📋 Available songs in demo mode:\n\n")
DemoMode::DEMO_TRACKS.each_with_index do |track, i|
puts "#{pastel.cyan((i+1).to_s.rjust(2))}. #{track[:title]}"
puts " #{pastel.dim("Duration:")} #{track[:duration]}"
puts ""
end
puts "\n" + pastel.dim("─" * 70) + "\n\n"
# Simulate search
puts pastel.yellow("🔍 Search example: 'lofi'\n\n")
results = DemoMode.search("lofi", 5)
puts pastel.green("Results found: #{results.length}\n\n")
results.each_with_index do |track, i|
puts " #{i+1}. #{track[:title]} [#{track[:duration]}]"
end
puts "\n" + pastel.dim("─" * 70) + "\n\n"
# Features
puts pastel.cyan.bold("✨ Features:\n\n")
features = [
"🎧 Play music from YouTube",
"🖥️ Simple terminal interface",
"⚡ Lightweight and fast",
"🎮 Intuitive controls (pause, next, volume, etc.)",
"🔍 Integrated search",
"📋 Playback queue",
"🎵 Offline demo mode"
]
features.each do |feature|
puts " #{feature}"
end
puts "\n" + pastel.dim("─" * 70) + "\n\n"
puts pastel.green.bold("To run the player:\n")
puts " #{pastel.white("./ongaku.rb")} - Normal mode (requires connection)"
puts " #{pastel.white("DEMO_MODE=1 ./ongaku.rb")} - Demo mode\n\n"
puts pastel.dim("Press Ctrl+C to exit this demo")
puts pastel.dim("or run the real player with the commands above\n")