Skip to content

Instantly share code, notes, and snippets.

@squentin
squentin / gst1-play.pl
Created August 25, 2015 21:24
Sample program to play one or more file with gstreamer-1.x
#!/usr/bin/perl
use warnings;
use strict;
use Glib;
use Glib::Object::Introspection;
Glib::Object::Introspection->setup(basename => 'Gst', version => '1.0', package => 'GStreamer1');
GStreamer1::init_check([ $0, @ARGV ]) or die "Can't initialize gstreamer-1.x\n";
my $reg= GStreamer1::Registry::get();
$reg->lookup_feature('playbin') or die "gstreamer-1.x plugin 'playbin' not found.\n";
@squentin
squentin / setfield.pl
Created July 28, 2014 16:36
Small script to set field to a given value for a given file
#!/bin/perl
use warnings;
use strict;
use Net::DBus;
my $bus = Net::DBus->session;
my $service = $bus->get_service('org.gmusicbrowser');
my $object = $service->get_object('/org/gmusicbrowser', 'org.gmusicbrowser');
die "Usage : $0 file(with full path) field value\n" unless @ARGV==3;
# Copyright (C) 2005-2010 Quentin Sculo <squentin@free.fr>
#
# This file is part of Gmusicbrowser.
# Gmusicbrowser is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation
=gmbplugin DEBUG
name Debug
title Debug plugin
# Copyright (C) 2009 Quentin Sculo <squentin@free.fr>
#
# This file is part of Gmusicbrowser.
# Gmusicbrowser is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation
=gmbplugin LOG
Log
Logging plugin
# Copyright (C) 2009 Quentin Sculo <squentin@free.fr>
#
# This file is part of Gmusicbrowser.
# Gmusicbrowser is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation
=gmbplugin LOG
name Log
title Logging plugin
# Copyright (C) 2010 Quentin Sculo <squentin@free.fr>
#
# This file is part of Gmusicbrowser.
# Gmusicbrowser is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation
=gmbplugin MPRIS
name MPRIS v1
title MPRIS v1 support
# Copyright (C) 2010 Andrew Clunis <andrew@orospakr.ca>
# Daniel Rubin <dan@fracturedproject.net>
# 2005-2009 Quentin Sculo <squentin@free.fr>
#
# This file is part of Gmusicbrowser.
# Gmusicbrowser is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation
=gmbplugin EPICRATING
diff --git a/gmusicbrowser.pl b/gmusicbrowser.pl
index 032e597..1df52e3 100755
--- a/gmusicbrowser.pl
+++ b/gmusicbrowser.pl
@@ -757,6 +757,7 @@ our ($RandomMode,$SortFields,$ListMode);
our ($SongID,$prevID,$Recent,$RecentPos,$Queue); our $QueueAction='';
our ($Position,$ChangedID,$ChangedPos,@NextSongs,$NextFileToPlay);
our ($MainWindow,$FullscreenWindow); my $OptionsDialog;
+my @UnmountedFolders;
my $TrayIcon;
@squentin
squentin / setplaycount.pl
Created March 17, 2011 15:43
example to set playcount for a song via DBus api
#!/bin/perl
use warnings;
use strict;
use Net::DBus;
my $bus = Net::DBus->session;
my $service = $bus->get_service('org.gmusicbrowser');
my $object = $service->get_object('/org/gmusicbrowser', 'org.gmusicbrowser');
die "Usage : $0 file(with full path) value\n" unless @ARGV==2;
@squentin
squentin / keypress_bypass.diff
Created September 9, 2011 21:11
bypass default shortcut keys except for entries and spinbuttons
diff --git a/gmusicbrowser_layout.pm b/gmusicbrowser_layout.pm
index ee3a576..d0dc82b 100644
--- a/gmusicbrowser_layout.pm
+++ b/gmusicbrowser_layout.pm
@@ -981,7 +981,7 @@ sub CreateWidgets
{ $widgets->{$_}->signal_connect(scroll_event => \&::ChangeVol)
for grep $widgets->{$_}, split /\s+/,$l;
}
- $self->signal_connect_after(key_press_event => \&KeyPressed);
+ $self->signal_connect(key_press_event => \&KeyPressed);