Discussion:
Default settings...
Nevyn
2011-02-11 00:08:21 UTC
Permalink
Hi Everyone,

I'm looking at wxcam and thinking to myself that it's got some really
horrible default settings. Everything is saved to the desktop and the
filenames are "video" and "image". It saves images as tif by default.

However, I can't see where it pulls these settings in from. If
~/.wxcam doesn't exist, it creates it with those settings. Does anyone
know where I might be able to force diofferent settings? I don't
really want to have to put .wxcam in /etc/skel and having a play with
the settings, it won't allow me to use ~ anyway.

Regards,
Nevyn
http://nevsramblings.blogspot.com/

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Bruce Clement
2011-02-11 00:59:45 UTC
Permalink
Here's your defaults & I'm afraid it isn't good news.

http://wxcam.cvs.sourceforge.net/viewvc/wxcam/wxcam/src/setting.cpp?revision=1.18&content-type=text%2Fplain

void Setting::WriteDefaults()
{
wxMutexLocker mLocker( mutex );
wxString s;
cfile->writeValueReplace( "Device:", "/dev/video0" );
cfile->writeValueReplace( "AudioDevice:", "/dev/dsp" );
cfile->writeValueReplace( "DriverAPI:", "AUTO" );
cfile->writeValueReplace( "Format:", "AUTO" );
s = wxFileName::GetHomeDir() + wxString("/Desktop/image.tif", wxConvUTF8);
cfile->writeValueReplace( "Snapshot:", (const char*)s.mb_str(wxConvUTF8) );
s = wxFileName::GetHomeDir() + wxString("/Desktop/video.avi", wxConvUTF8);
cfile->writeValueReplace( "Video:", (const char*)s.mb_str(wxConvUTF8) );
cfile->writeValueReplace( "Resolution:", "160x120" );
cfile->writeValueReplace( "Frame_Rate:", "15" );
cfile->writeValueReplace( "Compression:", "none" );
cfile->writeValueReplace( "Compression_Level:", "50" );
cfile->writeValueReplace( "Audio:", "Yes" );
cfile->writeValueReplace( "Silence:", "20" );
cfile->writeValueReplace( "Opened:", "No" );
cfile->writeValueReplace( "AdjustColors:", "No" );
cfile->writeValueReplace( "Negative:", "No" );
cfile->writeValueReplace( "Upturned:", "No" );
cfile->writeValueReplace( "Monochrome:", "No" );
cfile->writeValueReplace( "Mirror:", "No" );
cfile->writeValueReplace( "Blur:", "No" );
cfile->writeValueReplace( "Deriche:", "No" );
cfile->writeValueReplace( "Sharpen:", "No" );
cfile->writeValueReplace( "Noise:", "No" );
cfile->writeValueReplace( "Edge:", "No" );
cfile->writeValueReplace( "Laplacian:", "No" );
cfile->writeValueReplace( "DateTimeLabel:", "No" );
cfile->writeValueReplace( "VideoStd:", "None" );
}
Post by Nevyn
Hi Everyone,
I'm looking at wxcam and thinking to myself that it's got some really
horrible default settings. Everything is saved to the desktop and the
filenames are "video" and "image". It saves images as tif by default.
However, I can't see where it pulls these settings in from. If
~/.wxcam doesn't exist, it creates it with those settings. Does anyone
know where I might be able to force diofferent settings? I don't
really want to have to put .wxcam in /etc/skel and having a play with
the settings, it won't allow me to use ~ anyway.
Regards,
Nevyn
http://nevsramblings.blogspot.com/
_______________________________________________
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
--
Bruce Clement

Home:    http://www.clement.co.nz/
Twitter:    http://twitter.com/Bruce_Clement
Google Buzz: http://www.google.com/profiles/aotearoanz

"Before attempting to create something new, it is vital to have a good
appreciation of everything that already exists in this field." Mikhail
Kalashnikov

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Nevyn
2011-02-11 01:05:28 UTC
Permalink
Post by Bruce Clement
Here's your defaults & I'm afraid it isn't good news.
http://wxcam.cvs.sourceforge.net/viewvc/wxcam/wxcam/src/setting.cpp?revision=1.18&content-type=text%2Fplain
void Setting::WriteDefaults()
{
   wxMutexLocker mLocker( mutex );
   wxString s;
   cfile->writeValueReplace( "Device:", "/dev/video0" );
   cfile->writeValueReplace( "AudioDevice:", "/dev/dsp" );
   cfile->writeValueReplace( "DriverAPI:", "AUTO" );
   cfile->writeValueReplace( "Format:", "AUTO" );
   s = wxFileName::GetHomeDir() + wxString("/Desktop/image.tif", wxConvUTF8);
   cfile->writeValueReplace( "Snapshot:", (const char*)s.mb_str(wxConvUTF8) );
   s = wxFileName::GetHomeDir() + wxString("/Desktop/video.avi", wxConvUTF8);
   cfile->writeValueReplace( "Video:", (const char*)s.mb_str(wxConvUTF8) );
   cfile->writeValueReplace( "Resolution:", "160x120" );
   cfile->writeValueReplace( "Frame_Rate:", "15" );
   cfile->writeValueReplace( "Compression:", "none" );
   cfile->writeValueReplace( "Compression_Level:", "50" );
   cfile->writeValueReplace( "Audio:", "Yes" );
   cfile->writeValueReplace( "Silence:", "20" );
   cfile->writeValueReplace( "Opened:", "No" );
   cfile->writeValueReplace( "AdjustColors:", "No" );
   cfile->writeValueReplace( "Negative:", "No" );
   cfile->writeValueReplace( "Upturned:", "No" );
   cfile->writeValueReplace( "Monochrome:", "No" );
   cfile->writeValueReplace( "Mirror:", "No" );
   cfile->writeValueReplace( "Blur:", "No" );
   cfile->writeValueReplace( "Deriche:", "No" );
   cfile->writeValueReplace( "Sharpen:", "No" );
   cfile->writeValueReplace( "Noise:", "No" );
   cfile->writeValueReplace( "Edge:", "No" );
   cfile->writeValueReplace( "Laplacian:", "No" );
   cfile->writeValueReplace( "DateTimeLabel:", "No" );
   cfile->writeValueReplace( "VideoStd:", "None" );
}
Sweet. Yeah had just found it. It seems silly that you'd HAVE to
recompile the application to change the defaults. At some point I'm
going to have to make a patch to get it to look for something in
/etc/wxcam. If it doesn't exist, then set it with those defaults. If
.wxcam doesn't exist in the home dir, use the file from /etc....

Regards,
Nevyn
http://nevsramblings.blogspot.com/

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Bruce Clement
2011-02-11 02:13:28 UTC
Permalink
Post by Nevyn
It seems silly that you'd HAVE to
recompile the application to change the defaults.
At some point you need to have a fallback set of default values to use
if every other possible config file gets deleted off the system ... at
least these guys put them in an easy to find single routine.
--
Bruce Clement

Home:    http://www.clement.co.nz/
Twitter:    http://twitter.com/Bruce_Clement
Google Buzz: http://www.google.com/profiles/aotearoanz

"Before attempting to create something new, it is vital to have a good
appreciation of everything that already exists in this field." Mikhail
Kalashnikov

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Shiv Manas
2011-02-11 01:20:57 UTC
Permalink
Post by Nevyn
However, I can't see where it pulls these settings in from. If
~/.wxcam doesn't exist, it creates it with those settings. Does anyone
know where I might be able to force diofferent settings? I don't
really want to have to put .wxcam in /etc/skel and having a play with
the settings, it won't allow me to use ~ anyway.
Looks like it's hardcoded.

wxcam-1.07.tar.gz/src/setting.cpp :

s = wxFileName::GetHomeDir() + wxString("/Desktop/image.tif", wxConvUTF8);
cfile->writeValueReplace( "Snapshot:", (const char*)s.mb_str(wxConvUTF8) );
s = wxFileName::GetHomeDir() + wxString("/Desktop/video.avi", wxConvUTF8);
cfile->writeValueReplace( "Video:", (const char*)s.mb_str(wxConvUTF8) );


Regards,
Shiv

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Shiv Manas
2011-02-11 01:24:30 UTC
Permalink
Post by Shiv Manas
Post by Nevyn
However, I can't see where it pulls these settings in from. If
~/.wxcam doesn't exist, it creates it with those settings. Does anyone
know where I might be able to force diofferent settings? I don't
really want to have to put .wxcam in /etc/skel and having a play with
the settings, it won't allow me to use ~ anyway.
Looks like it's hardcoded.
   s = wxFileName::GetHomeDir() + wxString("/Desktop/image.tif", wxConvUTF8);
   cfile->writeValueReplace( "Snapshot:", (const char*)s.mb_str(wxConvUTF8) );
   s = wxFileName::GetHomeDir() + wxString("/Desktop/video.avi", wxConvUTF8);
   cfile->writeValueReplace( "Video:", (const char*)s.mb_str(wxConvUTF8) );
Regards,
Shiv
Whoops, looks like I've been beat to it. Sorry for the double-post!

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Continue reading on narkive:
Loading...