diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/SampleWindow.cc | 7 | ||||
-rw-r--r-- | src/SampleWindow.hh | 3 | ||||
-rw-r--r-- | src/ServerInfoManager.cc | 2 | ||||
-rw-r--r-- | src/ServerInfoManager.hh | 2 | ||||
-rw-r--r-- | src/StatWindow.cc | 8 | ||||
-rw-r--r-- | src/StatWindow.hh | 3 | ||||
-rw-r--r-- | src/paman.glade | 142 |
7 files changed, 139 insertions, 28 deletions
diff --git a/src/SampleWindow.cc b/src/SampleWindow.cc index b1ea149..5b254f0 100644 --- a/src/SampleWindow.cc +++ b/src/SampleWindow.cc @@ -11,6 +11,7 @@ SampleWindow::SampleWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Gl indexLabel(NULL), volumeLabel(NULL), sampleTypeLabel(NULL), + sizeLabel(NULL), durationLabel(NULL), closeButton(NULL) { @@ -19,6 +20,7 @@ SampleWindow::SampleWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Gl refGlade->get_widget("volumeLabel", volumeLabel); refGlade->get_widget("sampleTypeLabel", sampleTypeLabel); refGlade->get_widget("durationLabel", durationLabel); + refGlade->get_widget("sizeLabel", sizeLabel); refGlade->get_widget("closeButton", closeButton); closeButton->signal_clicked().connect(sigc::mem_fun(*this, &SampleWindow::onCloseButton)); @@ -32,7 +34,7 @@ SampleWindow* SampleWindow::create() { } void SampleWindow::updateInfo(const SampleInfo &i) { - char t[20], ss[PA_SAMPLE_SNPRINT_MAX_LENGTH]; + char t[60], ss[PA_SAMPLE_SNPRINT_MAX_LENGTH]; nameLabel->set_text(i.name); snprintf(t, sizeof(t), "#%u", i.index); @@ -46,6 +48,9 @@ void SampleWindow::updateInfo(const SampleInfo &i) { snprintf(t, sizeof(t), "%0.1fs", (double) i.duration/1000000); durationLabel->set_text(t); + + pa_bytes_snprint(t, sizeof(t), i.bytes); + sizeLabel->set_text(t); set_title("Sample: "+i.name); } diff --git a/src/SampleWindow.hh b/src/SampleWindow.hh index 61c8535..a7c99dd 100644 --- a/src/SampleWindow.hh +++ b/src/SampleWindow.hh @@ -17,7 +17,8 @@ public: *indexLabel, *volumeLabel, *sampleTypeLabel, - *durationLabel; + *durationLabel, + *sizeLabel; Gtk::Button *closeButton; diff --git a/src/ServerInfoManager.cc b/src/ServerInfoManager.cc index 55a3f3f..be934f8 100644 --- a/src/ServerInfoManager.cc +++ b/src/ServerInfoManager.cc @@ -249,6 +249,7 @@ SampleInfo::SampleInfo(const struct pa_sample_info &i) : sample_spec(i.sample_spec), volume(i.volume), duration(i.duration), + bytes(i.bytes), window(NULL) { } @@ -263,6 +264,7 @@ void SampleInfo::update(const struct pa_sample_info &i) { sample_spec = i.sample_spec; volume = i.volume; duration = i.duration; + bytes = i.bytes; if (window) window->updateInfo(*this); diff --git a/src/ServerInfoManager.hh b/src/ServerInfoManager.hh index 6762f75..3395de1 100644 --- a/src/ServerInfoManager.hh +++ b/src/ServerInfoManager.hh @@ -154,7 +154,7 @@ public: uint32_t index; Glib::ustring name; struct pa_sample_spec sample_spec; - uint32_t volume, duration; + uint32_t volume, duration, bytes; Gtk::TreeRowReference treeRef; diff --git a/src/StatWindow.cc b/src/StatWindow.cc index 7adb752..6e0c4b8 100644 --- a/src/StatWindow.cc +++ b/src/StatWindow.cc @@ -9,6 +9,7 @@ StatWindow::StatWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade: totalSizeLabel(NULL), allocatedLabel(NULL), allocatedSizeLabel(NULL), + sampleCacheLabel(NULL), closeButton(NULL), refreshButton(NULL), operation(NULL) { @@ -17,6 +18,7 @@ StatWindow::StatWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade: refGlade->get_widget("totalSizeLabel", totalSizeLabel); refGlade->get_widget("allocatedLabel", allocatedLabel); refGlade->get_widget("allocatedSizeLabel", allocatedSizeLabel); + refGlade->get_widget("sampleCacheLabel", sampleCacheLabel); refGlade->get_widget("closeButton", closeButton); refGlade->get_widget("refreshButton", refreshButton); @@ -51,12 +53,14 @@ static void stat_cb(struct pa_context *c, const struct pa_stat_info *i, void *us snprintf(t, sizeof(t), "%u", i->memblock_total); s->totalLabel->set_text(t); - snprintf(t, sizeof(t), "%u bytes", i->memblock_total_size); + pa_bytes_snprint(t, sizeof(t), i->memblock_total_size); s->totalSizeLabel->set_text(t); snprintf(t, sizeof(t), "%u", i->memblock_allocated); s->allocatedLabel->set_text(t); - snprintf(t, sizeof(t), "%u bytes", i->memblock_allocated_size); + pa_bytes_snprint(t, sizeof(t), i->memblock_allocated_size); s->allocatedSizeLabel->set_text(t); + pa_bytes_snprint(t, sizeof(t), i->scache_size); + s->sampleCacheLabel->set_text(t); pa_operation_unref(s->operation); s->operation = NULL; diff --git a/src/StatWindow.hh b/src/StatWindow.hh index 092404a..f3461f0 100644 --- a/src/StatWindow.hh +++ b/src/StatWindow.hh @@ -17,7 +17,8 @@ public: Gtk::Label *totalLabel, *totalSizeLabel, *allocatedLabel, - *allocatedSizeLabel; + *allocatedSizeLabel, + *sampleCacheLabel; Gtk::Button *closeButton, *refreshButton; diff --git a/src/paman.glade b/src/paman.glade index f6b2c17..958e6e5 100644 --- a/src/paman.glade +++ b/src/paman.glade @@ -4382,7 +4382,7 @@ <child> <widget class="GtkTable" id="table9"> <property name="visible">True</property> - <property name="n_rows">4</property> + <property name="n_rows">5</property> <property name="n_columns">2</property> <property name="homogeneous">False</property> <property name="row_spacing">12</property> @@ -4390,6 +4390,7 @@ <child> <widget class="GtkLabel" id="allocatedLabel"> + <property name="width_request">100</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="label" translatable="yes"></property> @@ -4398,7 +4399,7 @@ <property name="justify">GTK_JUSTIFY_LEFT</property> <property name="wrap">False</property> <property name="selectable">True</property> - <property name="xalign">0</property> + <property name="xalign">1</property> <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> @@ -4423,7 +4424,7 @@ <property name="justify">GTK_JUSTIFY_LEFT</property> <property name="wrap">False</property> <property name="selectable">True</property> - <property name="xalign">0</property> + <property name="xalign">1</property> <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> @@ -4448,7 +4449,7 @@ <property name="justify">GTK_JUSTIFY_LEFT</property> <property name="wrap">False</property> <property name="selectable">True</property> - <property name="xalign">0</property> + <property name="xalign">1</property> <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> @@ -4569,7 +4570,7 @@ <property name="justify">GTK_JUSTIFY_LEFT</property> <property name="wrap">False</property> <property name="selectable">True</property> - <property name="xalign">0</property> + <property name="xalign">1</property> <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> @@ -4583,6 +4584,55 @@ <property name="y_options"></property> </packing> </child> + + <child> + <widget class="GtkLabel" id="label4816"> + <property name="visible">True</property> + <property name="label" translatable="yes">Total Size of Sample Cache:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="sampleCacheLabel"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">True</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> </widget> <packing> <property name="padding">0</property> @@ -4679,7 +4729,7 @@ <widget class="GtkTable" id="table10"> <property name="border_width">12</property> <property name="visible">True</property> - <property name="n_rows">5</property> + <property name="n_rows">6</property> <property name="n_columns">2</property> <property name="homogeneous">False</property> <property name="row_spacing">6</property> @@ -4833,9 +4883,9 @@ </child> <child> - <widget class="GtkLabel" id="label4808"> + <widget class="GtkLabel" id="label4815"> <property name="visible">True</property> - <property name="label" translatable="yes"><b>Default Volume:</b></property> + <property name="label" translatable="yes"><b>Index:</b></property> <property name="use_underline">False</property> <property name="use_markup">True</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -4849,17 +4899,42 @@ <packing> <property name="left_attach">0</property> <property name="right_attach">1</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="label4815"> + <widget class="GtkLabel" id="indexLabel"> <property name="visible">True</property> - <property name="label" translatable="yes"><b>Index:</b></property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">label4816</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">True</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label4808"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Default Volume:</b></property> <property name="use_underline">False</property> <property name="use_markup">True</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -4873,18 +4948,18 @@ <packing> <property name="left_attach">0</property> <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="indexLabel"> + <widget class="GtkLabel" id="volumeLabel"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">label4816</property> + <property name="label" translatable="yes">label4813</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -4898,23 +4973,46 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="volumeLabel"> + <widget class="GtkLabel" id="label4818"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">label4813</property> + <property name="label" translatable="yes"><b>Size:</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="sizeLabel"> + <property name="visible">True</property> + <property name="label" translatable="yes">label4819</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> <property name="wrap">False</property> - <property name="selectable">True</property> + <property name="selectable">False</property> <property name="xalign">0</property> <property name="yalign">0.5</property> <property name="xpad">0</property> |