void MainErrorGUI::create_objects()
{
-SET_TRACE
BC_Button *button;
add_subwindow(button = new BC_OKButton(this));
int x = 10, y = 10;
-SET_TRACE
add_subwindow(title = new BC_Title(x, y, _("The following errors occurred:")));
y += title->get_h() + 5;
-SET_TRACE
add_subwindow(list = new BC_ListBox(x,
y,
get_w() - 20,
LISTBOX_SINGLE, // Select one item or multiple items
ICON_LEFT, // Position of icon relative to text of each item
0));
-SET_TRACE
show_window();
-SET_TRACE
}
int MainErrorGUI::resize_event(int w, int h)
{
char *out_ptr = string2;
// Indent remaining lines
- if(!first_line)
- {
+ if( !first_line ) {
*out_ptr++ = ' ';
*out_ptr++ = ' ';
}
errors.append(new BC_ListBoxItem(string2));
- if(*in_ptr == '\n')
- {
+ if( *in_ptr == '\n' ) {
in_ptr++;
first_line = 0;
}
void MainError::show_error_local(const char *string)
{
-SET_TRACE
// assume user won't get to closing the GUI here
lock_window("MainError::show_error_local");
-SET_TRACE
- if(get_gui())
- {
-SET_TRACE
+ if( get_gui() ) {
MainErrorGUI *gui = (MainErrorGUI*)get_gui();
gui->lock_window("MainError::show_error_local");
-SET_TRACE
append_error(string);
-SET_TRACE
- gui->list->update(&errors,
- 0,
- 0,
- 1,
- gui->list->get_xposition(),
- gui->list->get_yposition(),
+ gui->list->update(&errors, 0, 0, 1,
+ gui->list->get_xposition(), gui->list->get_yposition(),
gui->list->get_highlighted_item(), // Flat index of item cursor is over
0, // set all autoplace flags to 1
1);
-SET_TRACE
+ gui->raise_window(1);
gui->unlock_window();
- unlock_window();
-SET_TRACE
- start();
-SET_TRACE
}
- else
- {
- unlock_window();
-SET_TRACE
+ else {
errors.remove_all_objects();
-SET_TRACE
append_error(string);
-SET_TRACE
start();
-SET_TRACE
}
+ unlock_window();
}
void MainError::show_error(const char *string)
{
- if(main_error)
+ if( main_error )
main_error->show_error_local(string);
- else
- {
+ else {
printf("%s", string);
- if(string[strlen(string) - 1] != '\n')
+ if( string[strlen(string) - 1] != '\n' )
printf("\n");
}
}
char mtime[256];
strftime(mtime, sizeof(mtime), "%F %T", tm);
fprintf(fp,"mtime: %s\n", mtime);
-
+#if 0
+// people hit ctl-c waiting for this
int fd = open(proc_path,O_RDONLY+O_NONBLOCK);
if( fd < 0 ) { fprintf(fp,"open: %m\n"); return; }
uint8_t *bfr = 0;
for( int i=0; i<20; ++i ) fprintf(fp, "%02x", digest[i]);
if( ret < 0 ) fprintf(fp, " (ret %d)", ret);
if( pos < st.st_size ) fprintf(fp, " (pos %jd)", pos);
+#endif
fprintf(fp, "\n");
}
// Need PluginServer to do this.
void PluginAClientConfig::copy_from(PluginAClientConfig &that)
{
- int n = bmin(total_ports, that.total_ports);
- for( int i=0; i<n; ++i ) {
+ if( total_ports != that.total_ports ) {
+ delete_objects();
+ total_ports = that.total_ports;
+ port_data = new LADSPA_Data[total_ports];
+ port_type = new int[total_ports];
+ }
+ for( int i=0; i<total_ports; ++i ) {
port_type[i] = that.port_type[i];
port_data[i] = that.port_data[i];
}
total_outbuffers = 0;
buffer_allocation = 0;
lad_instance = 0;
+ snprintf(title, sizeof(title), "L_%s", server->lad_descriptor->Name);
}
PluginAClientLAD::~PluginAClientLAD()
const char* PluginAClientLAD::plugin_title()
{
- return (char*)server->lad_descriptor->Name;
+ return title;
}
int PluginAClientLAD::uses_gui()