From a1b9d110f0858a4a961a78b93a894d10855f2fcc Mon Sep 17 00:00:00 2001 From: kyak Date: Sun, 5 Jun 2011 17:48:30 +0400 Subject: [PATCH] lingot: not only guitar tuner using GTK --- lingot/Makefile | 48 +++++++++++++++++ lingot/files/lingot.conf | 40 ++++++++++++++ .../patches/001-gtk_widget_set_visible.patch | 18 +++++++ lingot/patches/002-320x240.patch | 53 +++++++++++++++++++ 4 files changed, 159 insertions(+) create mode 100644 lingot/Makefile create mode 100644 lingot/files/lingot.conf create mode 100644 lingot/patches/001-gtk_widget_set_visible.patch create mode 100644 lingot/patches/002-320x240.patch diff --git a/lingot/Makefile b/lingot/Makefile new file mode 100644 index 0000000..9b0c8f4 --- /dev/null +++ b/lingot/Makefile @@ -0,0 +1,48 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +include $(TOPDIR)/rules.mk + +PKG_NAME:=lingot +PKG_VERSION:=0.9.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://download.savannah.gnu.org/releases/lingot/ +PKG_MD5SUM:=363612bd55d3dc204d23cd26e25ef1f5 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/lingot + TITLE:=LINGOT Is Not a Guitar-Only Tuner + SECTION:=utilities + CATEGORY:=Utilities + URL:=http://www.nongnu.org/lingot/ + DEPENDS:=+alsa-lib +gtk2 +libglade +endef + +define Package/lingot/description + LINGOT is a musical instrument tuner. It's accurate, easy to use, and highly configurable. Originally conceived to tune electric guitars, it can now be used to tune other instruments. +endef + +CONFIGURE_ARGS += \ + --enable-alsa \ + --disable-jack + +TARGET_CFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib $(ICONV_CFLAGS) $(INTL_CFLAGS) + +define Package/lingot/install + $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/share/lingot/glade + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/lingot $(1)/usr/bin/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/glade/*.glade $(1)/usr/share/lingot/glade/ + $(CP) $(FILES_DIR)/lingot.conf $(1)/usr/share/lingot/ +endef + +define Package/lingot/postinst +#!/bin/sh +mkdir $${IPKG_INSTROOT}/root/.lingot && cp $${IPKG_INSTROOT}/usr/share/lingot/lingot.conf $${IPKG_INSTROOT}/root/.lingot/lingot.conf +endef + +$(eval $(call BuildPackage,lingot)) diff --git a/lingot/files/lingot.conf b/lingot/files/lingot.conf new file mode 100644 index 0000000..d7d6a6a --- /dev/null +++ b/lingot/files/lingot.conf @@ -0,0 +1,40 @@ +# Config file automatically created by lingot 0.9.0 + +AUDIO_SYSTEM = ALSA +AUDIO_DEV = /dev/dsp +AUDIO_DEV_ALSA = plughw:0 +SAMPLE_RATE = 8000 +OVERSAMPLING = 25 +ROOT_FREQUENCY_ERROR = 0.000 +MIN_FREQUENCY = 20.000 +FFT_SIZE = 256 +TEMPORAL_WINDOW = 0.800 +NOISE_THRESHOLD = 20.000 +CALCULATION_RATE = 4.000 +VISUALIZATION_RATE = 1.000 +PEAK_NUMBER = 3 +PEAK_HALF_WIDTH = 1 +PEAK_REJECTION_RELATION = 20.000 +DFT_NUMBER = 2 +DFT_SIZE = 15 +GAIN = 0.000 + +SCALE = { +NAME = Default equal-tempered scale +BASE_FREQUENCY = 261.625565 +NOTE_COUNT = 12 +NOTES = { +C 1/1 +C# 100.0000 +D 200.0000 +D# 300.0000 +E 400.0000 +F 500.0000 +F# 600.0000 +G 700.0000 +G# 800.0000 +A 900.0000 +A# 1000.0000 +B 1100.0000 +} +} diff --git a/lingot/patches/001-gtk_widget_set_visible.patch b/lingot/patches/001-gtk_widget_set_visible.patch new file mode 100644 index 0000000..12f3a0c --- /dev/null +++ b/lingot/patches/001-gtk_widget_set_visible.patch @@ -0,0 +1,18 @@ +diff --git a/src/lingot-gui-mainframe.c b/src/lingot-gui-mainframe.c +index 30c1b69..a6b35f5 100644 +--- a/src/lingot-gui-mainframe.c ++++ b/src/lingot-gui-mainframe.c +@@ -107,9 +107,10 @@ void lingot_gui_mainframe_callback_about(GtkWidget* w, LingotMainFrame* frame) { + + void lingot_gui_mainframe_callback_view_spectrum(GtkWidget* w, + LingotMainFrame* frame) { +- gtk_widget_set_visible(frame->spectrum_frame, +- gtk_check_menu_item_get_active( +- GTK_CHECK_MENU_ITEM(frame->view_spectrum_item))); ++ if (gtk_check_menu_item_get_active( ++ GTK_CHECK_MENU_ITEM(frame->view_spectrum_item))) { ++ gtk_widget_show(frame->spectrum_frame); ++ } + } + + void lingot_gui_mainframe_callback_config_dialog(GtkWidget* w, diff --git a/lingot/patches/002-320x240.patch b/lingot/patches/002-320x240.patch new file mode 100644 index 0000000..9a5a86e --- /dev/null +++ b/lingot/patches/002-320x240.patch @@ -0,0 +1,53 @@ +diff --git a/src/glade/lingot-mainframe.glade b/src/glade/lingot-mainframe.glade +index ce76be9..e0cf586 100644 +--- a/src/glade/lingot-mainframe.glade ++++ b/src/glade/lingot-mainframe.glade +@@ -136,7 +136,7 @@ + + + 160 +- 100 ++ 85 + True + Shows the error in cents in a visual way. The range will depend on the maximum distance between each two notes in the scale defined in the Lingot settings (try to provide scales with low maximum distance, i.e. with many notes, to have a higher resolution in this gauge), + +@@ -168,7 +168,7 @@ + + + 110 +- 100 ++ 85 + True + vertical + +@@ -233,7 +233,7 @@ + + + 290 +- 96 ++ 82 + True + True + automatic +diff --git a/src/lingot b/src/lingot +index 7c9a89c..87bb47e 100755 +Binary files a/src/lingot and b/src/lingot differ +diff --git a/src/lingot-gui-mainframe.c b/src/lingot-gui-mainframe.c +index 30c1b69..05d374a 100644 +--- a/src/lingot-gui-mainframe.c ++++ b/src/lingot-gui-mainframe.c +@@ -57,9 +57,9 @@ GdkColor freq_color; + // sizes + + int gauge_size_x = 160; +-int gauge_size_y = 100; ++int gauge_size_y = 85; + +-int spectrum_size_y = 64; ++int spectrum_size_y = 50; + + // spectrum area margins + int spectrum_bottom_margin = 16; +diff --git a/src/lingot-gui-mainframe.o b/src/lingot-gui-mainframe.o +index b36ff35..54b8c6c 100644 +Binary files a/src/lingot-gui-mainframe.o and b/src/lingot-gui-mainframe.o differ