Commit 8d9492fe authored by Jaromír Mikeš's avatar Jaromír Mikeš

Merge tag 'upstream/0.1.4'

Upstream version 0.1.4
# gpg: Signature made Thu 28 Jun 2012 02:35:44 PM CEST using RSA key ID E2B84FA5
# gpg: Good signature from "Jaromír Mikeš <mira.mikes@seznam.cz>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 4A54 3513 D2DF 6351 A817  8EA3 5B01 9455 E2B8 4FA5
parents 374e973f 49353bd5
tar -xjf petri-foo-0.1.3.tar.bz2
cd petri-foo-0.1.3
tar -xjf petri-foo-0.1.4.tar.bz2
cd petri-foo-0.1.4
cmake .
make
to run:
to run without installation:
gui/petri-foo
to install:
make install
......@@ -7,7 +7,7 @@ endif (COMMAND CMAKE_POLICY)
project(Petri-Foo)
set(Petri-Foo_VERSION_MAJOR 1)
set(Petri-Foo_VERSION_MINOR 3)
set(Petri-Foo_VERSION_MINOR 4)
set(BINDIR "bin" CACHE STRING "Where to install binaries")
set(DATADIR "share/petri-foo" CACHE STRING "Where to install data files")
set(APPLICATIONS_DIR "share/applications" CACHE STRING "Where to install desktop files")
......@@ -15,7 +15,6 @@ set(PIXMAPS_DIR "share/pixmaps" CACHE STRING "Where to install icons")
set(MIME_DIR "share/mime" CACHE STRING "Where MIME definitions are located")
set(UpdateMime "ON" CACHE BOOL "Update Mime Database")
set(PROJECT_VERSION "0.2.3")
set(ARCHIVE_NAME petri-foo-0.${Petri-Foo_VERSION_MAJOR}.${Petri-Foo_VERSION_MINOR})
mark_as_advanced(EXECUTABLE_OUTPUT_PATH)
......@@ -24,6 +23,7 @@ mark_as_advanced(CMAKE_BUILD_TYPE)
mark_as_advanced(CMAKE_INSTALL_PREFIX)
option (BuildForDebug "Include gdb debugging support" OFF)
option (GtkDeprecatedChecks "Check against use of API deprecated in GTK3" OFF)
# DEBUG
set (BuildOptionsDebug "-O0 -ggdb" CACHE STRING "Debug build flags")
......@@ -46,6 +46,9 @@ else (BuildForDebug)
message (STATUS "Building for ${CMAKE_BUILD_TYPE}, flags: ${CMAKE_C_FLAGS_RELEASE}")
endif (BuildForDebug)
if (GtkDeprecatedChecks)
add_definitions(-DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGSEAL_ENABLE -DGTK_DISABLE_SINGLE_INCLUDES)
endif (GtkDeprecatedChecks)
# PKG-CONFIG
find_package(PkgConfig REQUIRED)
......@@ -132,7 +135,7 @@ INCLUDE (CheckIncludeFiles)
CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H)
CHECK_INCLUDE_FILES (jack/session.h HAVE_JACK_SESSION_H)
CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
${CMAKE_CURRENT_BINARY_DIR}/config.h )
${CMAKE_CURRENT_SOURCE_DIR}/config.h )
link_libraries(m)
......@@ -145,6 +148,11 @@ ADD_SUBDIRECTORY( libpetrifui )
ADD_SUBDIRECTORY( libphin )
ADD_SUBDIRECTORY( gui )
if (BuildForDebug)
ADD_SUBDIRECTORY( sandbox )
endif (BuildForDebug)
#ADD_SUBDIRECTORY( pixmaps )
install (DIRECTORY pixmaps/ DESTINATION ${DATADIR}/pixmaps
......
2012-06-22 James Morris <james@jwm-art.net>
* Restored sliders visual aspect to pre-cairo days.
* Fixed bug in vertical slider mark drawing.
2012-06-21 James Morris <james@jwm-art.net>
* not kept up with the ChangeLog as usual...
2012-06-15 James Morris <james@jwm-art.net>
* gui/mod_section.c: prevent change of env mod source
......
......@@ -141,7 +141,7 @@ int bank_ops_save_as (GtkWidget* parent_window)
gtk_recent_manager_add_item (recent_manager,
g_filename_to_uri(name, NULL, NULL));
msg_log(MSG_MESSAGE, "Succesfully wrote file %s\n", name);
msg_log(MSG_MESSAGE, "Successfully wrote file %s\n", name);
free(last_bank);
last_bank = strdup(name);
set_bankname(name);
......@@ -227,7 +227,7 @@ int bank_ops_open(GtkWidget* parent_window)
msg_log(MSG_WARNING, "Bank %s read with errors\n", name);
}
else
msg_log(MSG_MESSAGE, "Succesfully read bank %s\n", name);
msg_log(MSG_MESSAGE, "Successfully read bank %s\n", name);
gtk_recent_manager_add_item(recent_manager,
g_filename_to_uri(name, NULL, NULL));
......@@ -291,7 +291,7 @@ int bank_ops_open_recent(GtkWidget* parent_window, char* filename)
msg_log(MSG_WARNING, "Bank %s read with errors\n", filename);
}
else
msg_log(MSG_MESSAGE, "Succesfully read bank %s\n", filename);
msg_log(MSG_MESSAGE, "Successfully read bank %s\n", filename);
gtk_recent_manager_add_item (recent_manager,
g_filename_to_uri(filename, NULL, NULL));
......
......@@ -109,7 +109,7 @@ static void thresh_cb(GtkWidget* w, BoolSectionPrivate* p)
{
patch_bool_set_thresh( p->patch_id,
p->bool_type,
phin_fan_slider_get_value(PHIN_FAN_SLIDER(w)));
phin_slider_get_value(PHIN_SLIDER(w)));
}
......@@ -194,7 +194,7 @@ void bool_section_set_bool( BoolSection* self, PatchBoolType bool_type)
mod_src_combo_set_model(GTK_COMBO_BOX(p->mod_combo), MOD_SRC_GLOBALS);
gui_attach(t, p->mod_combo, b1, b2, y, y + 1);
p->thresh = phin_hfan_slider_new_with_range(0.0, -1.0, 1.0, 0.1);
p->thresh = phin_hslider_new_with_range(0.0, -1.0, 1.0, 0.1);
gui_attach(t, p->thresh, c1, c2, y, y + 1);
gtk_widget_set_tooltip_text(p->thresh, "Switch threshold");
++y;
......@@ -251,7 +251,7 @@ void bool_section_set_patch(BoolSection* self, int patch_id)
block(p);
phin_fan_slider_set_value(PHIN_FAN_SLIDER(p->thresh), thresh);
phin_slider_set_value(PHIN_SLIDER(p->thresh), thresh);
if (!mod_src_combo_get_iter_with_id(GTK_COMBO_BOX(p->mod_combo),
modsrc,
......
This diff is collapsed.
......@@ -41,7 +41,7 @@ struct _FloatSectionPrivate
int patch_id;
PatchFloatType float_type;
GtkWidget* float_fan;
GtkWidget* floatval;
GtkWidget* mod_combo;
GtkWidget* mod_amt;
};
......@@ -60,7 +60,7 @@ static void float_section_class_init(FloatSectionClass* klass)
static void float_cb(GtkWidget* w, FloatSectionPrivate* p)
{
float val = phin_fan_slider_get_value(PHIN_FAN_SLIDER(w));
float val = phin_slider_get_value(PHIN_SLIDER(w));
patch_float_set_value(p->patch_id, p->float_type, val);
}
......@@ -77,13 +77,13 @@ static void mod_amt_cb(GtkWidget* w, FloatSectionPrivate* p)
{
patch_float_set_mod_amt(p->patch_id,
p->float_type,
phin_fan_slider_get_value(PHIN_FAN_SLIDER(w)));
phin_slider_get_value(PHIN_SLIDER(w)));
}
static void block(FloatSectionPrivate* p)
{
g_signal_handlers_block_by_func(p->float_fan, float_cb, p);
g_signal_handlers_block_by_func(p->floatval, float_cb, p);
g_signal_handlers_block_by_func(p->mod_amt, mod_amt_cb, p);
g_signal_handlers_block_by_func(p->mod_combo, mod_combo_cb, p);
}
......@@ -91,7 +91,7 @@ static void block(FloatSectionPrivate* p)
static void unblock(FloatSectionPrivate* p)
{
g_signal_handlers_unblock_by_func(p->float_fan, float_cb, p);
g_signal_handlers_unblock_by_func(p->floatval, float_cb, p);
g_signal_handlers_unblock_by_func(p->mod_amt, mod_amt_cb, p);
g_signal_handlers_unblock_by_func(p->mod_combo, mod_combo_cb, p);
}
......@@ -103,7 +103,7 @@ static void float_section_init(FloatSection* self)
FloatSectionPrivate* p = FLOAT_SECTION_GET_PRIVATE(self);
p->patch_id = -1;
p->float_type = PATCH_FLOAT_INVALID;
p->float_fan = 0;
p->floatval = 0;
p->mod_combo = 0;
p->mod_amt = 0;
}
......@@ -160,10 +160,10 @@ void float_section_set_float( FloatSection* self, PatchFloatType float_type)
gui_attach(t, gui_hpad_new(GUI_TEXTSPACE), c1, c2, y, y + 1);
++y;
p->float_fan = phin_hfan_slider_new_with_range(0.0, floatmin,
p->floatval = phin_hslider_new_with_range(0.0, floatmin,
floatmax,
floatstep);
gui_attach(t, p->float_fan, b1, b2, y, y + 1);
gui_attach(t, p->floatval, b1, b2, y, y + 1);
++y;
gui_label_attach("Mod:", t, a1, a2, y, y + 1);
......@@ -172,11 +172,11 @@ void float_section_set_float( FloatSection* self, PatchFloatType float_type)
mod_src_combo_set_model(GTK_COMBO_BOX(p->mod_combo), MOD_SRC_GLOBALS);
gui_attach(t, p->mod_combo, b1, b2, y, y + 1);
p->mod_amt = phin_hfan_slider_new_with_range(0.0, -1.0, 1.0, 0.1);
p->mod_amt = phin_hslider_new_with_range(0.0, -1.0, 1.0, 0.1);
gui_attach(t, p->mod_amt, c1, c2, y, y + 1);
++y;
g_signal_connect(G_OBJECT(p->float_fan), "value-changed",
g_signal_connect(G_OBJECT(p->floatval), "value-changed",
G_CALLBACK(float_cb), (gpointer)p);
g_signal_connect(G_OBJECT(p->mod_amt), "value-changed",
......@@ -229,8 +229,8 @@ void float_section_set_patch(FloatSection* self, int patch_id)
&modsrc);
block(p);
phin_fan_slider_set_value(PHIN_FAN_SLIDER(p->float_fan), assign);
phin_fan_slider_set_value(PHIN_FAN_SLIDER(p->mod_amt), mod_amt);
phin_slider_set_value(PHIN_SLIDER(p->floatval), assign);
phin_slider_set_value(PHIN_SLIDER(p->mod_amt), mod_amt);
if (!mod_src_combo_get_iter_with_id(GTK_COMBO_BOX(p->mod_combo),
modsrc,
......
......@@ -144,14 +144,14 @@ int settings_read(const char* path)
gbl_settings->last_bank_dir =
(char*) xmlGetProp(node2, BAD_CAST "value");
}
/*
if (xmlStrcmp(prop, BAD_CAST "sliders-use-fans") == 0)
{
phin_fan_slider_set_fans_active(
xmlstr_to_gboolean(xmlGetProp(node2,
BAD_CAST "value")));
}
*/
if (xmlStrcmp(prop, BAD_CAST "log-lines") == 0)
{
xmlChar* vprop = xmlGetProp(node2, BAD_CAST "value");
......@@ -263,6 +263,7 @@ int settings_write()
xmlNewProp(node2, BAD_CAST "value",
BAD_CAST gbl_settings->last_bank_dir);
/*
node2 = xmlNewTextChild(node1, NULL, BAD_CAST "property", NULL);
xmlNewProp(node2, BAD_CAST "name", BAD_CAST "sliders-use-fans");
xmlNewProp(node2, BAD_CAST "type", BAD_CAST "boolean");
......@@ -270,7 +271,7 @@ int settings_write()
BAD_CAST (phin_fan_slider_get_fans_active()
? "true"
: "false"));
*/
node2 = xmlNewTextChild(node1, NULL, BAD_CAST "property", NULL);
xmlNewProp(node2, BAD_CAST "name", BAD_CAST "last-bank-directory");
xmlNewProp(node2, BAD_CAST "type", BAD_CAST "string");
......
......@@ -73,7 +73,7 @@ static GtkWidget* menuitem_file_recent = 0;
/* settings */
static GtkWidget* menu_settings_fans = 0;
/*static GtkWidget* menu_settings_fans = 0;*/
static GtkWidget* menu_settings_auto_preview = 0;
/* current patch, makes passing patch id to sample editor easier */
......@@ -478,6 +478,7 @@ static void cb_menu_settings_audio (GtkWidget * widget, gpointer data)
}
/*
static void cb_menu_settings_fans(GtkWidget* widget, gpointer data)
{
(void)widget;(void)data;
......@@ -485,7 +486,7 @@ static void cb_menu_settings_fans(GtkWidget* widget, gpointer data)
gtk_check_menu_item_get_active(
GTK_CHECK_MENU_ITEM(menu_settings_fans)));
}
*/
static void cb_menu_settings_auto_preview(GtkWidget* widget, gpointer data)
{
......@@ -624,11 +625,11 @@ int gui_init(void)
G_CALLBACK(cb_menu_patch_remove), NULL);
/* settings menu */
/* use slider fans */
menu_settings = gui_menu_add(menubar, "Settings", NULL, NULL);
gui_menu_add(menu_settings, "Audio...",
G_CALLBACK(cb_menu_settings_audio), NULL);
/* use slider fans
menu_settings_fans =
gtk_check_menu_item_new_with_label("Use slider fans");
gtk_check_menu_item_set_active(
......@@ -639,6 +640,7 @@ int gui_init(void)
gtk_menu_shell_append(GTK_MENU_SHELL(menu_settings),
menu_settings_fans);
gtk_widget_show(menu_settings_fans);
*/
/* auto-preview */
menu_settings_auto_preview =
......
This diff is collapsed.
......@@ -43,11 +43,11 @@ static void master_section_class_init(MasterSectionClass* klass)
}
static void amplitude_changed_cb(PhinFanSlider* slider, gpointer data)
static void amp_changed_cb(PhinSlider* sl, gpointer data)
{
(void)data;
float val;
val = phin_fan_slider_get_value(slider);
val = phin_slider_get_value(sl);
mixer_set_amplitude(val);
}
......@@ -63,17 +63,17 @@ static void master_section_init(MasterSection* self)
/* amplitude */
label = gtk_label_new(NULL);
self->amplitude_fan =
phin_hfan_slider_new_with_range(DEFAULT_AMPLITUDE, 0.0, 1.0, 0.1);
self->amp = phin_hslider_new_with_range(DEFAULT_AMPLITUDE,
0.0, 1.0, 0.1);
hbox = gtk_hbox_new(FALSE, GUI_TEXTSPACE);
gtk_label_set_markup(GTK_LABEL(label), "<b>Master</b>");
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox), self->amplitude_fan, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(hbox), self->amp, TRUE, TRUE, 0);
gtk_box_pack_start(box, hbox, FALSE, FALSE, 0);
gtk_widget_show(label);
gtk_widget_show(self->amplitude_fan);
gtk_widget_show(self->amp);
gtk_widget_show(hbox);
/* pad */
......@@ -82,8 +82,8 @@ static void master_section_init(MasterSection* self)
gtk_widget_show(pad);
/* signal */
g_signal_connect(self->amplitude_fan, "value-changed",
G_CALLBACK(amplitude_changed_cb), NULL);
g_signal_connect(self->amp, "value-changed",
G_CALLBACK(amp_changed_cb), NULL);
}
......@@ -95,14 +95,13 @@ GtkWidget* master_section_new(void)
void master_section_update(MasterSection* self)
{
float amplitude;
float amp;
amplitude = mixer_get_amplitude();
amp = mixer_get_amplitude();
g_signal_handlers_block_by_func(self->amplitude_fan,
(gpointer)amplitude_changed_cb, NULL);
g_signal_handlers_block_by_func(self->amp,
G_CALLBACK(amp_changed_cb), NULL);
phin_fan_slider_set_value(PHIN_FAN_SLIDER(self->amplitude_fan), amplitude);
g_signal_handlers_unblock_by_func(self->amplitude_fan, amplitude_changed_cb, NULL);
phin_slider_set_value(PHIN_SLIDER(self->amp), amp);
g_signal_handlers_unblock_by_func(self->amp, amp_changed_cb, NULL);
}
......@@ -53,7 +53,7 @@ typedef struct _MasterSection MasterSection;
struct _MasterSection
{
GtkVBox parent_instance;
GtkWidget* amplitude_fan; /* <private> */
GtkWidget* amp; /* <private> */
};
......
......@@ -65,7 +65,7 @@ static void mod_section_class_init(ModSectionClass* klass)
static void param1_cb(GtkWidget* w, ModSectionPrivate* p)
{
float val = phin_fan_slider_get_value(PHIN_FAN_SLIDER(w));
float val = phin_slider_get_value(PHIN_SLIDER(w));
patch_param_set_value(p->patch_id, p->param, val);
}
......@@ -80,13 +80,13 @@ static void param2_cb(GtkWidget* w, ModSectionPrivate* p)
static void vel_sens_cb(GtkWidget* w, ModSectionPrivate* p)
{
float val = phin_fan_slider_get_value(PHIN_FAN_SLIDER(w));
float val = phin_slider_get_value(PHIN_SLIDER(w));
patch_param_set_vel_amount(p->patch_id, p->param, val);
}
static void key_track_cb(GtkWidget* w, ModSectionPrivate* p)
{
float val = phin_fan_slider_get_value(PHIN_FAN_SLIDER(w));
float val = phin_slider_get_value(PHIN_SLIDER(w));
patch_param_set_key_amount(p->patch_id, p->param, val);
}
......@@ -125,7 +125,7 @@ static void mod_amount_cb(GtkWidget* w, ModSectionPrivate* p)
val = phin_slider_button_get_value(PHIN_SLIDER_BUTTON(w))
/ PATCH_MAX_PITCH_STEPS;
else
val = phin_fan_slider_get_value(PHIN_FAN_SLIDER(w));
val = phin_slider_get_value(PHIN_SLIDER(w));
for (i = 0; i < last_slot; ++i)
if (w == p->mod_amount[i])
......@@ -348,9 +348,9 @@ debug("creating mod section...\n");
gui_label_attach(lstr, t, a1, a2, y, y + 1);
p->param1 = phin_hfan_slider_new_with_range(0.0, range_low,
p->param1 = phin_hslider_new_with_range(0.0, range_low,
range_hi, 0.1);
phin_fan_slider_set_log(PHIN_FAN_SLIDER(p->param1), logscale);
phin_slider_set_log(PHIN_SLIDER(p->param1), logscale);
gui_attach(t, p->param1, b1, b2, y, y + 1);
......@@ -363,13 +363,13 @@ debug("creating mod section...\n");
/* velocity sensitivity */
gui_label_attach("Vel.Sens:", t, a1, a2, y, y + 1);
p->vel_sens = phin_hfan_slider_new_with_range(0.0, -1.0, 1.0, 0.1);
p->vel_sens = phin_hslider_new_with_range(0.0, -1.0, 1.0, 0.1);
gui_attach(t, p->vel_sens, b1, b2, y, y + 1);
++y;
/* key tracking */
gui_label_attach("Key Track:", t, a1, a2, y, y + 1);
p->key_track = phin_hfan_slider_new_with_range(0.0, -1.0, 1.0, 0.1);
p->key_track = phin_hslider_new_with_range(0.0, -1.0, 1.0, 0.1);
gui_attach(t, p->key_track, b1, b2, y, y + 1);
++y;
......@@ -398,7 +398,7 @@ create_mod_srcs:
if (param == PATCH_PARAM_PITCH)
p->mod_amount[i] = mod_src_new_pitch_adjustment();
else
p->mod_amount[i] = phin_hfan_slider_new_with_range(0.0, -1.0,
p->mod_amount[i] = phin_hslider_new_with_range(0.0, -1.0,
1.0, 0.1);
gui_attach(t, p->mod_amount[i], c1, c2, y, y + 1);
++y;
......@@ -494,13 +494,13 @@ get_mod_srcs:
if (p->mod_only)
goto set_mod_srcs;
phin_fan_slider_set_value(PHIN_FAN_SLIDER(p->param1), param1);
phin_slider_set_value(PHIN_SLIDER(p->param1), param1);
if (p->param == PATCH_PARAM_PITCH)
phin_slider_button_set_value(PHIN_SLIDER_BUTTON(p->param2), param2);
phin_fan_slider_set_value(PHIN_FAN_SLIDER(p->key_track), key_trk);
phin_fan_slider_set_value(PHIN_FAN_SLIDER(p->vel_sens), vel_amt);
phin_slider_set_value(PHIN_SLIDER(p->key_track), key_trk);
phin_slider_set_value(PHIN_SLIDER(p->vel_sens), vel_amt);
set_mod_srcs:
......@@ -518,7 +518,7 @@ set_mod_srcs:
}
else if (i < last_slot)
{
phin_fan_slider_set_value(PHIN_FAN_SLIDER(p->mod_amount[i]),
phin_slider_set_value(PHIN_SLIDER(p->mod_amount[i]),
modamt[i]);
gtk_widget_set_sensitive(p->mod_amount[i],
modsrc[i] != MOD_SRC_NONE);
......
include_directories ( . )
include_directories ( . .. )
ADD_SUBDIRECTORY( patch_private )
......
......@@ -937,7 +937,7 @@ inline static int advance (Patch* p, PatchVoice* v, int index)
default:
if (v->relset == 0)
{
debug("release mode: CUTOFF\n");
/*debug("release mode: CUTOFF\n");*/
playstate_init_fade_out(p, v);
}
......
/* Petri-Foo is a fork of the Specimen audio sampler.
Original Specimen author Pete Bessman
Copyright 2005 Pete Bessman
Copyright 2011 James W. Morris
This file is part of Petri-Foo.
Petri-Foo is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
Petri-Foo is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Petri-Foo. If not, see <http://www.gnu.org/licenses/>.
This file is a derivative of a Specimen original, modified 2011
*/
#include "pf_error.h"
#include "petri-foo.h"
......
/* Petri-Foo is a fork of the Specimen audio sampler.
Copyright 2011 James W. Morris
This file is part of Petri-Foo.
Petri-Foo is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
Petri-Foo is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Petri-Foo. If not, see <http://www.gnu.org/licenses/>.
This file is a derivative of a Specimen original, modified 2011
*/
#ifndef PF_ERROR_H
#define PF_ERROR_H
......
......@@ -24,9 +24,9 @@
#ifndef __PHIN_H__
#define __PHIN_H__
#include <phinvfanslider.h>
#include <phinhfanslider.h>
#include <phinfanslider.h>
#include <phinhslider.h>
#include <phinvslider.h>
#include <phinslider.h>
#include <phinsliderbutton.h>
#include <phinkeyboard.h>
#include <phinvkeyboard.h>
......
......@@ -25,16 +25,16 @@
#include "phinprivate.h"
#include "phinfanslider.h"
#include "phinhfanslider.h"
#include "phinslider.h"
#include "phinhslider.h"
G_DEFINE_TYPE(PhinHFanSlider, phin_hfan_slider, PHIN_TYPE_FAN_SLIDER);
G_DEFINE_TYPE(PhinHSlider, phin_hslider, PHIN_TYPE_SLIDER);
GtkWidget* phin_hfan_slider_new (GtkAdjustment* adjustment)
GtkWidget* phin_hslider_new (GtkAdjustment* adjustment)
{
PhinHFanSlider* slider;
PhinHSlider* slider;
gdouble adj_lower = gtk_adjustment_get_lower(adjustment);
gdouble adj_upper = gtk_adjustment_get_upper(adjustment);
......@@ -44,35 +44,35 @@ GtkWidget* phin_hfan_slider_new (GtkAdjustment* adjustment)
g_assert((adj_value >= adj_lower)
&& (adj_value <= adj_upper));
slider = g_object_new (PHIN_TYPE_HFAN_SLIDER, NULL);
slider = g_object_new (PHIN_TYPE_HSLIDER, NULL);
phin_fan_slider_set_orientation(PHIN_FAN_SLIDER(slider),
phin_slider_set_orientation(PHIN_SLIDER(slider),
GTK_ORIENTATION_HORIZONTAL);
phin_fan_slider_set_adjustment( PHIN_FAN_SLIDER (slider), adjustment);
phin_slider_set_adjustment( PHIN_SLIDER (slider), adjustment);
return (GtkWidget*) slider;
}
GtkWidget* phin_hfan_slider_new_with_range (double value, double lower,
GtkWidget* phin_hslider_new_with_range (double value, double lower,
double upper, double step)
{
GtkAdjustment* adj;
adj = (GtkAdjustment*)gtk_adjustment_new(value, lower, upper,
step, step, 0);
return phin_hfan_slider_new (adj);
return phin_hslider_new (adj);
}
static void phin_hfan_slider_class_init(PhinHFanSliderClass* klass)
static void phin_hslider_class_init(PhinHSliderClass* klass)
{
phin_hfan_slider_parent_class = g_type_class_peek_parent(klass);
phin_hslider_parent_class = g_type_class_peek_parent(klass);
}
static void phin_hfan_slider_init(PhinHFanSlider* slider)
static void phin_hslider_init(PhinHSlider* slider)
{
(void)slider;
return;
......
......@@ -21,56 +21,56 @@
This file is a derivative of a PHAT original, modified 2011
*/
#ifndef __PHIN_HFAN_SLIDER_H__
#define __PHIN_HFAN_SLIDER_H__
#ifndef __PHIN_HSLIDER_H__
#define __PHIN_HSLIDER_H__
#include <gtk/gtk.h>
#include "phinfanslider.h"
#include "phinslider.h"
G_BEGIN_DECLS
#define PHIN_TYPE_HFAN_SLIDER \
(phin_hfan_slider_get_type())
#define PHIN_TYPE_HSLIDER \
(phin_hslider_get_type())
#define PHIN_HFAN_SLIDER(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), PHIN_TYPE_HFAN_SLIDER, \
PhinHFanSlider))
#define PHIN_HSLIDER(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), PHIN_TYPE_HSLIDER, \
PhinHSlider))
#define PHIN_IS_HFAN_SLIDER(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), PHIN_TYPE_HFAN_SLIDER))
#define PHIN_IS_HSLIDER(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), PHIN_TYPE_HSLIDER))
#define PHIN_HFAN_SLIDER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), PHIN_TYPE_HFAN_SLIDER, \
PhinHFanSliderClass))
#define PHIN_HSLIDER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), PHIN_TYPE_HSLIDER, \
PhinHSliderClass))
#define PHIN_IS_HFAN_SLIDER_CLASS(klass) \
(G_TYPE_CHECK_INSTANCE_TYPE ((klass), PHIN_TYPE_HFAN_SLIDER))
#define PHIN_IS_HSLIDER_CLASS(klass) \
(G_TYPE_CHECK_INSTANCE_TYPE ((klass), PHIN_TYPE_HSLIDER))
typedef struct _PhinHFanSliderClass PhinHFanSliderClass;
typedef struct _PhinHFanSlider PhinHFanSlider;
typedef struct _PhinHSliderClass PhinHSliderClass;
typedef struct _PhinHSlider PhinHSlider;
struct _PhinHFanSlider
struct _PhinHSlider
{
PhinFanSlider parent;
PhinSlider parent;
};
struct _PhinHFanSliderClass
struct _PhinHSliderClass
{
PhinFanSliderClass parent_class;
PhinSliderClass parent_class;
};
GType phin_hfan_slider_get_type ( );
GType phin_hslider_get_type ( );
GtkWidget* phin_hfan_slider_new (GtkAdjustment* adjustment);
GtkWidget* phin_hslider_new (GtkAdjustment* adjustment);
GtkWidget* phin_hfan_slider_new_with_range (double value,
GtkWidget* phin_hslider_new_with_range (double value,
double lower,
double upper,
double step);
G_END_DECLS
#endif /* __PHIN_HFAN_SLIDER_H__ */
#endif /* __PHIN_HSLIDER_H__ */
......@@ -42,77 +42,73 @@
along with Phin. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __PHIN_FAN_SLIDER_H__
#define __PHIN_FAN_SLIDER_H__
#ifndef __PHIN_SLIDER_H__
#define __PHIN_SLIDER_H__
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define PHIN_TYPE_FAN_SLIDER (phin_fan_slider_get_type())
#define PHIN_FAN_SLIDER(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), PHIN_TYPE_FAN_SLIDER, \
PhinFanSlider))
#define PHIN_TYPE_SLIDER (phin_slider_get_type())
#define PHIN_SLIDER(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), PHIN_TYPE_SLIDER, \
PhinSlider))
#define PHIN_FAN_SLIDER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), PHIN_TYPE_FAN_SLIDER, \
PhinFanSliderClass))
#define PHIN_SLIDER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), PHIN_TYPE_SLIDER, \
PhinSliderClass))
#define PHIN_IS_FAN_SLIDER(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), PHIN_TYPE_FAN_SLIDER))
#define PHIN_IS_SLIDER(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), PHIN_TYPE_SLIDER))