Index: src/file_handling/basic_header.h
===================================================================
--- src/file_handling/basic_header.h	(revision 556)
+++ src/file_handling/basic_header.h	(working copy)
@@ -38,7 +38,7 @@
     {return recording_info_;}
 
     //-------------------------------------------------------------------------
-    float getSampleRate () const;
+    float64 getSampleRate () const;
 
     //-------------------------------------------------------------------------
     QSharedPointer<SignalChannel const> getChannel (ChannelID id) const;
@@ -47,7 +47,7 @@
     unsigned getNumberChannels() const;
 
     //-------------------------------------------------------------------------
-    virtual uint32 getNumberOfSamples () const = 0;
+    virtual size_t getNumberOfSamples () const = 0;
 
     //-------------------------------------------------------------------------
     virtual QMap<unsigned, QString> getNamesOfUserSpecificEvents () const
@@ -73,7 +73,7 @@
 
     //-------------------------------------------------------------------------
     /// required
-    void setSampleRate (float sample_rate);
+    void setSampleRate (float64 sample_rate);
 
     //-------------------------------------------------------------------------
     /// required
@@ -92,7 +92,7 @@
 private:
     QString const file_path_;
     QString file_type_string_;
-    float sample_rate_;
+    float64 sample_rate_;
     QMap<ChannelID, QSharedPointer<SignalChannel const> > channels_;
     QMap<QString, QString> recording_info_;
     QMap<QString, QString> patient_info_;
Index: src/file_handling/channel_manager.h
===================================================================
--- src/file_handling/channel_manager.h	(revision 556)
+++ src/file_handling/channel_manager.h	(working copy)
@@ -43,13 +43,13 @@
                                                      unsigned length) const = 0;
 
     //-------------------------------------------------------------------------
-    virtual float32 getDurationInSec () const = 0;
+    virtual float64 getDurationInSec () const = 0;
 
     //-------------------------------------------------------------------------
-    virtual uint32 getNumberSamples () const = 0;
+    virtual size_t getNumberSamples () const = 0;
 
     //-------------------------------------------------------------------------
-    virtual float32 getSampleRate () const = 0;
+    virtual float64 getSampleRate () const = 0;
 
     //-------------------------------------------------------------------------
     void addDownsampledMinMaxVersion (ChannelID id, QSharedPointer<DataBlock const> min,
Index: src/file_handling/basic_header.cpp
===================================================================
--- src/file_handling/basic_header.cpp	(revision 556)
+++ src/file_handling/basic_header.cpp	(working copy)
@@ -12,7 +12,7 @@
 }
 
 //-----------------------------------------------------------------------------
-float32 BasicHeader::getSampleRate () const
+float64 BasicHeader::getSampleRate () const
 {
     return sample_rate_;
 }
@@ -61,7 +61,7 @@
 }
 
 //-------------------------------------------------------------------------
-void BasicHeader::setSampleRate (float sample_rate)
+void BasicHeader::setSampleRate (float64 sample_rate)
 {
     sample_rate_ = sample_rate;
 }
Index: src/src.pro
===================================================================
--- src/src.pro	(revision 556)
+++ src/src.pro	(working copy)
@@ -33,7 +33,7 @@
 INCLUDEPATH += $$_PRO_FILE_PWD_/../extern/include \
                $$_PRO_FILE_PWD_/.
 LIBS += -L$$_PRO_FILE_PWD_/../extern/lib \
-    -lbiosig# \
+    -lbiosig -lcholmod -lz -lcurl \
     #-lGDF
 
 RESOURCES = src.qrc
Index: src/version.txt
===================================================================
--- src/version.txt	(revision 556)
+++ src/version.txt	(working copy)
@@ -1,2 +1,2 @@
-0.5.1
+0.5.1-as.5
 
Index: src/file_handling_impl/sinus_dummy_reader.cpp
===================================================================
--- src/file_handling_impl/sinus_dummy_reader.cpp	(revision 556)
+++ src/file_handling_impl/sinus_dummy_reader.cpp	(working copy)
@@ -29,10 +29,11 @@
             data->push_back (sin(sample_index / ((i*i+1))));
         QSharedPointer<DataBlock const> data_block (new FixedDataBlock (data, 100));
         data_.insert(i, data_block);
-
+/*
         QSharedPointer<SignalChannel> channel (new SignalChannel(i,
                                                    QString::number(i)));
         header->addDummyChannel(i, channel);
+*/
         header_ = header;
     }
 
Index: src/file_handling_impl/biosig_reader.cpp
===================================================================
--- src/file_handling_impl/biosig_reader.cpp	(revision 556)
+++ src/file_handling_impl/biosig_reader.cpp	(working copy)
@@ -4,7 +4,7 @@
     Copyright (C) Thomas Brunner  2005,2006,2007
     Copyright (C) Christoph Eibel 2007,2008
     Copyright (C) Clemens Brunner 2006,2007,2008
-    Copyright (C) Alois Schloegl  2008,2009
+    Copyright (C) Alois Schloegl  2008,2009,2011
     Copyright (C) Oliver Terbu    2008
     This file is part of the "SigViewer" repository
     at http://biosig.sf.net/
@@ -57,6 +57,12 @@
 FILE_SIGNAL_READER_REGISTRATION(cnt, BioSigReader);
 FILE_SIGNAL_READER_REGISTRATION(vhdr, BioSigReader);
 FILE_SIGNAL_READER_REGISTRATION(bkr, BioSigReader);
+FILE_SIGNAL_READER_REGISTRATION(gz,  BioSigReader);
+FILE_SIGNAL_READER_REGISTRATION(itx, BioSigReader);
+FILE_SIGNAL_READER_REGISTRATION(rec, BioSigReader);
+FILE_SIGNAL_READER_REGISTRATION(acq, BioSigReader);
+FILE_SIGNAL_READER_REGISTRATION(bva, BioSigReader);
+FILE_SIGNAL_READER_REGISTRATION(hea, BioSigReader);
 
 FILE_SIGNAL_READER_REGISTRATION(evt, BioSigReader);
 
@@ -101,10 +107,8 @@
 void BioSigReader::doClose () const
 {
     if (biosig_header_)
-    {
-        sclose (biosig_header_);
         destructHDR (biosig_header_);
-    }
+
     biosig_header_ = 0;
 }
 
@@ -181,7 +185,7 @@
             destructHDR(biosig_header_);
             biosig_header_ = 0;
             delete c_file_name;
-            return "file not supported";
+            return B4C_ERRMSG;
     }
 
     // (C) 2008 AS: EVENT.DUR and EVENT.CHN are optional in SOPEN, but SigViewer needs them.
@@ -281,10 +285,10 @@
 void BioSigReader::bufferAllEvents () const
 {
     unsigned number_events = biosig_header_->EVENT.N;
+    // Hack Hack: Transforming Events to have the same sample rate as the signals
+    double rate_transition = basic_header_->getEventSamplerate() / biosig_header_->EVENT.SampleRate;
     for (unsigned index = 0; index < number_events; index++)
     {
-        // Hack Hack: Transforming Events to have the same sample rate as the signals
-        double rate_transition = basic_header_->getEventSamplerate() / biosig_header_->EVENT.SampleRate;
         QSharedPointer<SignalEvent> event (new SignalEvent (biosig_header_->EVENT.POS[index] * rate_transition,
                                                             biosig_header_->EVENT.TYP[index],
                                                             biosig_header_->EVENT.SampleRate * rate_transition));
@@ -295,7 +299,12 @@
             else
                 event->setChannel (biosig_header_->EVENT.CHN[index] - 1);
             event->setDuration (biosig_header_->EVENT.DUR[index] * rate_transition);
-        }
+        } 
+	else 
+	{
+		event->setChannel (UNDEFINED_CHANNEL);
+		event->setDuration (1);
+	}
         events_.append (event);
     }
 
Index: src/file_handling_impl/biosig_writer.cpp
===================================================================
--- src/file_handling_impl/biosig_writer.cpp	(revision 556)
+++ src/file_handling_impl/biosig_writer.cpp	(working copy)
@@ -73,7 +73,7 @@
                                               std::set<EventType> const& types)
 {
     if (file_formats_support_event_saving_.count(target_type_) == 0)
-        return QObject::tr("Can't write events to that file that file type!");
+        return QObject::tr("Can't write events to that file type!");
 
 
     QList<EventID> events;
@@ -109,7 +109,6 @@
     if (error)
         QMessageBox::critical(0, "Events not saved!!!", QString::number(error));
 
-    sclose (header);
     destructHDR (header);
 
     return "";
Index: src/file_handling_impl/event_table_file_reader.cpp
===================================================================
--- src/file_handling_impl/event_table_file_reader.cpp	(revision 556)
+++ src/file_handling_impl/event_table_file_reader.cpp	(working copy)
@@ -1,3 +1,25 @@
+/*
+
+    $Id$
+    Copyright (C) Christoph Eibel 2010 
+    Copyright (C) Alois Schloegl  2011
+		and others ???
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 3
+    of the License, or (at your option) any later version.
+
+    This program 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 this program.  If not, see <http://www.gnu.org/licenses/>. 
+    
+*/
+
 #include "event_table_file_reader.h"
 
 #include <QFile>
@@ -16,9 +38,8 @@
 //-------------------------------------------------------------------------------------------------
 EventTableFileReader::EventTableFileReader()
 {
-    QSettings settings;
-    QString event_codes_file = settings.value ("eventcodes_file", ":/eventcodes.txt").toString();
-    load (event_codes_file);
+    load ();
+
     event_group_ids_.append (UNKNOWN_GROUP_ID);
     group_id2name_[UNKNOWN_GROUP_ID] = UNKNOWN_GROUP_ID;
 }
@@ -29,60 +50,28 @@
     // nothing
 }
 
-// load
-bool EventTableFileReader::load(const QString& file_name)
+// load pre-defined event codes from libbiosig
+bool EventTableFileReader::load()
 {
-    event_file_path_ = file_name;
-    QFile file(file_name);
-    if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
-        return false;
-
-    // load event type table
-    QTextStream file_stream(&file); 
-    QString group_id;
-    while (true)
-    {
-        QString one_line = file_stream.readLine();
-        if (one_line.isEmpty())
-        {
-            break;
-        }
-        if (one_line.indexOf("### 0x") == 0)
-        {
-            group_id = one_line.mid(4, 6);
-            if (!group_id2name_.contains(group_id))
-            {
-                QString group_name;
-                int32 begin_name = one_line.indexOf(QRegExp("[^ \t]"), 10);
-                if (begin_name != -1)
-                {
-                    group_name = one_line.mid(begin_name);
-                }
-                group_id2name_[group_id] = group_name;
+	char g[10];
+	uint16_t k;
+	for (k = 0; EventCodeGroups[k].groupid < 0xffff; k++) {
+	        sprintf(g,"0x%04x", EventCodeGroups[k].groupid);
+		QString group_id = QString(g);
+	        group_id2name_[group_id] = QString(EventCodeGroups[k].GroupDescription);
                 event_group_ids_ << group_id;
-            }
-        }
-        else if (one_line.indexOf("0x") == 0)
-        {
-            uint16 event_type_id = one_line.mid(0, 6).toInt(0, 16);
-            if (!event_type2name_.contains(event_type_id))
-            {
-                EventItem item;
-                int32 begin_name = one_line.indexOf(QRegExp("[^ \t]"), 6);
-                if (begin_name != -1)
-                {
-                    item.name = one_line.mid(begin_name);
-                }
+	}
+
+        EventItem item;
+	for (k=0; ETD[k].typ ; k++) {
+	        sprintf(g,"0x%04x", ETD[k].groupid);
+		QString group_id = QString(g);
+		item.name     =  QString(ETD[k].desc);
                 item.group_id = group_id;
-                event_type2name_[event_type_id] = item;
-                event_types_ << event_type_id;
-            }
-        }
-    }
-    file.close();
-    qSort(event_types_);
-    qSort(event_group_ids_);
-    return true;
+                event_type2name_[ETD[k].typ] = item;
+                event_types_ << ETD[k].typ;
+	}
+        return true;
 }
 
 // get group id begin
@@ -127,7 +116,7 @@
 //-----------------------------------------------------------------------------
 void EventTableFileReader::restoreEventNames ()
 {
-    load (event_file_path_);
+    load ();
 }
 
 //-----------------------------------------------------------------------------
Index: src/file_handling_impl/file_handling_impl.pri
===================================================================
--- src/file_handling_impl/file_handling_impl.pri	(revision 556)
+++ src/file_handling_impl/file_handling_impl.pri	(working copy)
@@ -5,8 +5,8 @@
     file_handling_impl/event_table_file_reader.h \
     file_handling_impl/channel_manager_impl.h \
     file_handling_impl/biosig_basic_header.h \
-    file_handling_impl/sinus_dummy_reader.h \
-    file_handling_impl/sinus_dummy_header.h \
+    #file_handling_impl/sinus_dummy_reader.h \
+    #file_handling_impl/sinus_dummy_header.h \
     file_handling_impl/file_handler_factory_registrator.h #\
     #file_handling_impl/gdf/gdf_file_signal_writer.h \
     #file_handling_impl/gdf/gdf_file_signal_reader.h \
@@ -23,8 +23,8 @@
     file_handling_impl/event_table_file_reader.cpp \
     file_handling_impl/channel_manager_impl.cpp \
     file_handling_impl/biosig_basic_header.cpp \
-    file_handling_impl/sinus_dummy_reader.cpp \
-    file_handling_impl/sinus_dummy_header.cpp #\
+    #file_handling_impl/sinus_dummy_reader.cpp \
+    #file_handling_impl/sinus_dummy_header.cpp #\
     #file_handling_impl/gdf/gdf_file_signal_writer.cpp \
     #file_handling_impl/gdf/gdf_file_signal_reader.cpp \
     #file_handling_impl/gdf/gdf_basic_header.cpp \
Index: src/file_handling_impl/event_table_file_reader.h
===================================================================
--- src/file_handling_impl/event_table_file_reader.h	(revision 556)
+++ src/file_handling_impl/event_table_file_reader.h	(working copy)
@@ -1,3 +1,27 @@
+/*
+
+    $Id$
+    Copyright (C) Christoph Eibel 2010 
+    Copyright (C) Alois Schloegl  2011
+		and others ???
+    This file is part of the "SigViewer" repository 
+    at http://biosig.sf.net/ 
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 3
+    of the License, or (at your option) any later version.
+
+    This program 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 this program.  If not, see <http://www.gnu.org/licenses/>. 
+    
+*/
+
 // event_table_file_reader.h
 
 #ifndef EVENT_TABLE_FILE_READER
@@ -4,6 +28,7 @@
 #define EVENT_TABLE_FILE_READER
 
 #include "base/sigviewer_user_types.h"
+#include "biosig.h"
 
 #include <QStringList>
 #include <QMap>
@@ -11,6 +36,7 @@
 
 #include <set>
 
+
 class QTextStream;
 
 namespace SigViewer_
@@ -53,8 +79,7 @@
 
     std::set<uint16> getAllEventTypes () const;
 private:
-    bool load(const QString& file_name);
-
+    bool load();
     static QString const UNKNOWN_GROUP_ID;
 
     struct EventItem
@@ -69,11 +94,11 @@
     Q_DISABLE_COPY(EventTableFileReader)
 
     QList<EventType> event_types_;
+    Int2EventItemMap event_type2name_;
+
     QStringList event_group_ids_;
-    Int2EventItemMap event_type2name_;
     String2StringMap group_id2name_;
 
-    QString event_file_path_;
 };
 
 } // namespace SigViewer_
Index: src/file_handling_impl/channel_manager_impl.cpp
===================================================================
--- src/file_handling_impl/channel_manager_impl.cpp	(revision 556)
+++ src/file_handling_impl/channel_manager_impl.cpp	(working copy)
@@ -66,7 +66,7 @@
 }
 
 //-----------------------------------------------------------------------------
-float32 ChannelManagerImpl::getDurationInSec () const
+float64 ChannelManagerImpl::getDurationInSec () const
 {
     return reader_->getBasicHeader()->getNumberOfSamples() /
            reader_->getBasicHeader()->getSampleRate();
@@ -74,13 +74,13 @@
 
 
 //-----------------------------------------------------------------------------
-uint32 ChannelManagerImpl::getNumberSamples () const
+size_t ChannelManagerImpl::getNumberSamples () const
 {
     return reader_->getBasicHeader()->getNumberOfSamples();
 }
 
 //-----------------------------------------------------------------------------
-float32 ChannelManagerImpl::getSampleRate () const
+float64 ChannelManagerImpl::getSampleRate () const
 {
     return reader_->getBasicHeader()->getSampleRate();
 }
Index: src/file_handling_impl/biosig_basic_header.cpp
===================================================================
--- src/file_handling_impl/biosig_basic_header.cpp	(revision 556)
+++ src/file_handling_impl/biosig_basic_header.cpp	(working copy)
@@ -1,3 +1,26 @@
+/*
+
+    $Id$
+    Copyright (C) Christoph Eibel 2010, 2011
+    Copyright (C) Alois Schloegl 2011
+    This file is part of the "SigViewer" repository
+    at http://biosig.sf.net/
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 3
+    of the License, or (at your option) any later version.
+
+    This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
 #include "biosig_basic_header.h"
 
 #include <ctime>
@@ -16,14 +39,14 @@
         for (unsigned index = 0; index < raw_header->EVENT.LenCodeDesc; index++)
         {
             if (raw_header->EVENT.CodeDesc[index])
-                user_defined_event_map_[index+1] = QString(raw_header->EVENT.CodeDesc[index]);
+                user_defined_event_map_[index] = QString(raw_header->EVENT.CodeDesc[index]);
         }
     }
 
 
     setFileTypeString (QString (GetFileTypeString(raw_header->TYPE)).append(" v").append(QString::number(raw_header->VERSION)));
 
-    float sampling_rate = raw_header->SampleRate;
+    float64 sampling_rate = raw_header->SampleRate;
 
     setSampleRate (sampling_rate);
     readChannelsInfo (raw_header);
@@ -32,7 +55,7 @@
 }
 
 //-----------------------------------------------------------------------------
-uint32 BiosigBasicHeader::getNumberOfSamples () const
+size_t BiosigBasicHeader::getNumberOfSamples () const
 {
     return ceil(static_cast<double>(number_samples_));
 }
@@ -48,6 +71,7 @@
 {
     for (unsigned channel_index = 0; channel_index < raw_header->NS; channel_index++)
     {
+/*
         QString label = QString (QByteArray(raw_header->CHANNEL[channel_index].Label, MAX_LENGTH_LABEL)).trimmed();
 
         char p[MAX_LENGTH_PHYSDIM+1];
@@ -56,8 +80,8 @@
         QString phys_y_dim_label = QString (p).trimmed();
         if (phys_y_dim_label.compare("uV") == 0)
             phys_y_dim_label = QString (QChar((ushort)0xb5)).append("V");
-        QSharedPointer<SignalChannel> channel (new SignalChannel(channel_index, label,
-                                                                 phys_y_dim_label));
+*/
+        QSharedPointer<SignalChannel> channel (new SignalChannel(channel_index, raw_header));
         addChannel (channel_index, channel);
     }
 }
Index: src/file_handling_impl/channel_manager_impl.h
===================================================================
--- src/file_handling_impl/channel_manager_impl.h	(revision 556)
+++ src/file_handling_impl/channel_manager_impl.h	(working copy)
@@ -41,13 +41,13 @@
                                                      unsigned length) const;
 
     //-------------------------------------------------------------------------
-    virtual float32 getDurationInSec () const;
+    virtual float64 getDurationInSec () const;
 
     //-------------------------------------------------------------------------
-    virtual uint32 getNumberSamples () const;
+    virtual size_t getNumberSamples () const;
 
     //-------------------------------------------------------------------------
-    virtual float32 getSampleRate () const;
+    virtual float64 getSampleRate () const;
 
 private:
     FileSignalReader* reader_;
Index: src/file_handling_impl/sinus_dummy_header.h
===================================================================
--- src/file_handling_impl/sinus_dummy_header.h	(revision 556)
+++ src/file_handling_impl/sinus_dummy_header.h	(working copy)
@@ -13,7 +13,7 @@
     SinusDummyHeader ();
 
     //-------------------------------------------------------------------------
-    virtual uint32 getNumberOfSamples () const {return 10000;}
+    virtual size_t getNumberOfSamples () const {return 10000;}
 
     //-------------------------------------------------------------------------
     void addDummyChannel (ChannelID id, QSharedPointer<SignalChannel const> channel)
Index: src/file_handling_impl/biosig_basic_header.h
===================================================================
--- src/file_handling_impl/biosig_basic_header.h	(revision 556)
+++ src/file_handling_impl/biosig_basic_header.h	(working copy)
@@ -14,7 +14,7 @@
     BiosigBasicHeader (HDRTYPE* raw_header, QString const& file_path);
 
     //-------------------------------------------------------------------------
-    virtual uint32 getNumberOfSamples () const;
+    virtual size_t getNumberOfSamples () const;
 
     //-------------------------------------------------------------------------
     virtual QMap<unsigned, QString> getNamesOfUserSpecificEvents () const;
Index: src/gui_impl/signal_browser/signal_browser_model_4.cpp
===================================================================
--- src/gui_impl/signal_browser/signal_browser_model_4.cpp	(revision 556)
+++ src/gui_impl/signal_browser/signal_browser_model_4.cpp	(working copy)
@@ -358,7 +358,7 @@
 //-------------------------------------------------------------------------
 void SignalBrowserModel::goToSample (unsigned sample)
 {
-    float32 position = 0;
+    float64 position = 0;
     while (position < getSignalViewSettings()->getPixelsPerSample() * sample)
         position += getSignalViewSettings()->getPixelsPerSample();
     position -= getSignalViewSettings()->getPixelsPerSample();
Index: src/gui_impl/dialogs/basic_header_info_dialog.cpp
===================================================================
--- src/gui_impl/dialogs/basic_header_info_dialog.cpp	(revision 556)
+++ src/gui_impl/dialogs/basic_header_info_dialog.cpp	(working copy)
@@ -1,3 +1,26 @@
+/*
+
+    $Id: biosig_reader.cpp,v 1.36 2009/03/03 11:57:07 cle1109 Exp $
+    Copyright (C) Christoph Eibel 2010, 2011
+    Copyright (C) Alois Schloegl  2011
+    This file is part of the "SigViewer" repository
+    at http://biosig.sf.net/
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 3
+    of the License, or (at your option) any later version.
+
+    This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
 // basic_header_info_dialog.cpp
 
 #include "basic_header_info_dialog.h"
@@ -176,7 +199,9 @@
         tmp_item = new QTreeWidgetItem(channel_item);
 
         tmp_item->setText(0, tr("Sample Rate"));
-        tmp_item->setText(1, QString::number(basic_header_->getSampleRate()));
+        float64 fs = channel->getSampleRate();
+        if (fs < 0.0) fs = basic_header_->getSampleRate();
+        tmp_item->setText(1, QString::number(fs));
         tmp_item->setText(2, tr("Hz"));
 
         tmp_item = new QTreeWidgetItem(channel_item);
Index: src/gui_impl/dialogs/about_dialog.ui
===================================================================
--- src/gui_impl/dialogs/about_dialog.ui	(revision 556)
+++ src/gui_impl/dialogs/about_dialog.ui	(working copy)
@@ -47,17 +47,11 @@
 &lt;tr&gt;
 &lt;td style=&quot;border: none;&quot;&gt;
 &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:11pt; font-weight:600;&quot;&gt;SigViewer [VERSION-NUMBER]&lt;/span&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;http://sigviewer.sf.net&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:8pt; text-decoration: underline; color:#0000ff;&quot;&gt;http://sigviewer.sourceforge.net/&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;http://sigviewer.sf.net&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:8pt; text-decoration: underline; color:#0000ff;&quot;&gt;http://biosig.sourceforge.net/&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
 &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:8pt; text-decoration: underline; color:#0000ff;&quot;&gt;&lt;/p&gt;
 &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:8pt;&quot;&gt;Clemens Brunner (Coordinator)&lt;/span&gt;&lt;/p&gt;
 &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:8pt;&quot;&gt;Christoph Eibel&lt;/span&gt;&lt;/p&gt;
 &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:8pt;&quot;&gt;Thomas Brunner&lt;/span&gt;&lt;/p&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:8pt;&quot;&gt;Laboratory of Brain-Computer Interfaces&lt;/span&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:8pt;&quot;&gt;Graz University of Technology&lt;/span&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;http://bci.tugraz.at&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:8pt; text-decoration: underline; color:#0000ff;&quot;&gt;http://bci.tugraz.at/&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:8pt;&quot;&gt;Thanks to:&lt;/span&gt;&lt;/p&gt;
 &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:8pt;&quot;&gt;Alois Schlögl (&lt;/span&gt;&lt;a href=&quot;http://biosig.sourceforge.net/&quot;&gt;&lt;span style=&quot; font-size:8pt; text-decoration: underline; color:#0000ff;&quot;&gt;BioSig&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:8pt;&quot;&gt;)&lt;/span&gt;&lt;/p&gt;
 &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:8pt;&quot;&gt;Laurent de Soras (&lt;/span&gt;&lt;a href=&quot;http://ldesoras.free.fr/prod.html&quot;&gt;&lt;span style=&quot; font-size:8pt; text-decoration: underline; color:#0000ff;&quot;&gt;FFTReal&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:8pt;&quot;&gt;)&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
        </property>
Index: src/gui_impl/processed_signal_channel_manager.cpp
===================================================================
--- src/gui_impl/processed_signal_channel_manager.cpp	(revision 556)
+++ src/gui_impl/processed_signal_channel_manager.cpp	(working copy)
@@ -4,7 +4,7 @@
 {
 
 //-------------------------------------------------------------------------
-ProcessedSignalChannelManager::ProcessedSignalChannelManager (float32 sample_rate, unsigned length, QObject* parent)
+ProcessedSignalChannelManager::ProcessedSignalChannelManager (float64 sample_rate, unsigned length, QObject* parent)
     : QObject (parent),
       sample_rate_ (sample_rate),
       length_ (length)
@@ -69,19 +69,19 @@
 }
 
 //-------------------------------------------------------------------------
-float32 ProcessedSignalChannelManager::getDurationInSec () const
+float64 ProcessedSignalChannelManager::getDurationInSec () const
 {
     return static_cast<float32>(length_) / sample_rate_;
 }
 
 //-------------------------------------------------------------------------
-uint32 ProcessedSignalChannelManager::getNumberSamples () const
+size_t ProcessedSignalChannelManager::getNumberSamples () const
 {
     return length_;
 }
 
 //-------------------------------------------------------------------------
-float32 ProcessedSignalChannelManager::getSampleRate () const
+float64 ProcessedSignalChannelManager::getSampleRate () const
 {
     return sample_rate_;
 }
Index: src/gui_impl/processed_signal_channel_manager.h
===================================================================
--- src/gui_impl/processed_signal_channel_manager.h	(revision 556)
+++ src/gui_impl/processed_signal_channel_manager.h	(working copy)
@@ -13,7 +13,7 @@
 {
 public:
     //-------------------------------------------------------------------------
-    ProcessedSignalChannelManager (float32 sample_rate, unsigned length, QObject* parent);
+    ProcessedSignalChannelManager (float64 sample_rate, unsigned length, QObject* parent);
 
     //-------------------------------------------------------------------------
     void addChannel (ChannelID id, QSharedPointer<DataBlock const> data_block,
@@ -44,13 +44,13 @@
                                                      unsigned length) const;
 
     //-------------------------------------------------------------------------
-    virtual float32 getDurationInSec () const;
+    virtual float64 getDurationInSec () const;
 
     //-------------------------------------------------------------------------
-    virtual uint32 getNumberSamples () const;
+    virtual size_t getNumberSamples () const;
 
     //-------------------------------------------------------------------------
-    virtual float32 getSampleRate () const;
+    virtual float64 getSampleRate () const;
 
 private:
     float32 sample_rate_;
Index: src/gui_impl/commands/adapt_event_view_gui_command.cpp
===================================================================
--- src/gui_impl/commands/adapt_event_view_gui_command.cpp	(revision 556)
+++ src/gui_impl/commands/adapt_event_view_gui_command.cpp	(working copy)
@@ -128,8 +128,8 @@
 
     QSharedPointer<SignalEvent const> event = events.first();
 
-    float32 width = currentVisModel()->view()->getViewportWidth();
-    float32 desired_pixel_per_sample = width / event->getDuration ();
+    float64 width = currentVisModel()->view()->getViewportWidth();
+    float64 desired_pixel_per_sample = width / event->getDuration ();
 
     currentSignalViewSettings()->setPixelsPerSample (desired_pixel_per_sample);
     currentVisModel()->goToSample (event->getPosition ());
Index: src/base/fixed_data_block.cpp
===================================================================
--- src/base/fixed_data_block.cpp	(revision 556)
+++ src/base/fixed_data_block.cpp	(working copy)
@@ -10,7 +10,7 @@
 
 //-------------------------------------------------------------------------------------------------
 FixedDataBlock::FixedDataBlock (QSharedPointer<QVector<float32> > data,
-                                float32 sample_rate_per_unit)
+                                float64 sample_rate_per_unit)
     : DataBlock (data->size(), sample_rate_per_unit),
       data_ (data),
       start_index_ (0)
@@ -135,7 +135,7 @@
 
     std::list<QSharedPointer<DataBlock const> >::const_iterator it = data_blocks.begin();
     QSharedPointer<QVector<float32> > mean (new QVector<float32>);
-    float32 sample_rate = (*it)->getSampleRatePerUnit ();
+    float64 sample_rate = (*it)->getSampleRatePerUnit ();
     float32 tmp_mean = 0;
     for (unsigned index = 0; index < (*(data_blocks.begin()))->size(); index++)
     {
@@ -174,7 +174,7 @@
         return QSharedPointer<DataBlock>(0);
 
     std::list<QSharedPointer<DataBlock const> >::const_iterator it = data_blocks.begin();
-    float32 sample_rate = (*it)->getSampleRatePerUnit ();
+    float64 sample_rate = (*it)->getSampleRatePerUnit ();
     float32 tmp_stddev = 0;
     for (unsigned index = 0; index < (*(data_blocks.begin()))->size(); index++)
     {
Index: src/base/signal_channel.cpp
===================================================================
--- src/base/signal_channel.cpp	(revision 556)
+++ src/base/signal_channel.cpp	(working copy)
@@ -4,7 +4,7 @@
     Copyright (C) Thomas Brunner  2006,2007 
     Copyright (C) Christoph Eibel 2007,2008, 
     Copyright (C) Clemens Brunner 2006,2007,2008  
-    Copyright (C) Alois Schloegl  2008,2009
+    Copyright (C) Alois Schloegl  2008,2009,2011
     This file is part of the "SigViewer" repository 
     at http://biosig.sf.net/ 
 
@@ -31,14 +31,60 @@
 {
 
 //-----------------------------------------------------------------------------
+SignalChannel::SignalChannel (unsigned ch,
+                              const HDRTYPE* hdr) :
+    number_ (ch),
+    label_ (QString(hdr->CHANNEL[ch].Label).trimmed()),
+    physical_maximum_(hdr->CHANNEL[ch].PhysMax), 	 
+    digital_maximum_(hdr->CHANNEL[ch].DigMax), 	 
+    physical_minimum_(hdr->CHANNEL[ch].PhysMin), 	 
+    digital_minimum_(hdr->CHANNEL[ch].DigMin), 	 
+    data_type_(hdr->CHANNEL[ch].GDFTYP), 	 
+    lowpass_(hdr->CHANNEL[ch].LowPass), 	 
+    highpass_(hdr->CHANNEL[ch].HighPass), 	 
+    notch_(hdr->CHANNEL[ch].Notch) 	 
+
+{
+/*
+     scale_ = (C.PhysMax - C.PhysMin) / (C.DigMax - C.DigMin); 	 
+     offset_ = C.PhysMin - C.DigMin * scale_; 	 
+*/
+     char p[MAX_LENGTH_PHYSDIM+1]; 	 
+     PhysDim(hdr->CHANNEL[ch].PhysDimCode,p); 	 
+     phys_y_dimension_label_ = QString(p);
+     samplerate_ = hdr->SampleRate * hdr->CHANNEL[ch].SPR / hdr->SPR; 
+}
+
 SignalChannel::SignalChannel (unsigned number,
-                              QString const& label,
-                              QString const& phys_y_dimension_label) :
+                              CHANNEL_STRUCT C) :
+
+    /* obsolete */                              
     number_ (number),
-    label_ (label),
-    phys_y_dimension_label_ (phys_y_dimension_label)
+    label_ (QString(C.Label).trimmed()),
+    physical_maximum_(C.PhysMax), 	 
+    digital_maximum_(C.DigMax), 	 
+    physical_minimum_(C.PhysMin), 	 
+    digital_minimum_(C.DigMin), 	 
+    data_type_(C.GDFTYP), 	 
+    lowpass_(C.LowPass), 	 
+    highpass_(C.HighPass), 	 
+    notch_(C.Notch) 	 
+
 {
+/*
+     scale_ = (C.PhysMax - C.PhysMin) / (C.DigMax - C.DigMin); 	 
+     offset_ = C.PhysMin - C.DigMin * scale_; 	 
+*/
+     char p[MAX_LENGTH_PHYSDIM+1]; 	 
+     PhysDim(C.PhysDimCode,p); 	 
+     phys_y_dimension_label_ = QString(p);
+     samplerate_ = -1.0; 
+}
 
+//-----------------------------------------------------------------------------
+float64 SignalChannel::getSampleRate() const
+{
+    return samplerate_;
 }
 
 //-----------------------------------------------------------------------------
Index: src/base/fixed_data_block.h
===================================================================
--- src/base/fixed_data_block.h	(revision 556)
+++ src/base/fixed_data_block.h	(working copy)
@@ -22,7 +22,7 @@
     /// @param sample_rate_per_unit as a data_block must not represent data which
     ///                             is associated to time, the sample_rate is given
     ///                             in "per unit" (e.g. "s" or "hz", etc.)
-    FixedDataBlock (QSharedPointer<QVector<float32> > data, float32 sample_rate_per_unit);
+    FixedDataBlock (QSharedPointer<QVector<float32> > data, float64 sample_rate_per_unit);
 
     //-------------------------------------------------------------------------
     virtual ~FixedDataBlock () {}
Index: src/base/math_utils.cpp
===================================================================
--- src/base/math_utils.cpp	(revision 556)
+++ src/base/math_utils.cpp	(working copy)
@@ -55,7 +55,7 @@
 }
 
 //-----------------------------------------------------------------------------
-int sampleRateToDecimalPrecision (float sample_rate)
+int sampleRateToDecimalPrecision (float64 sample_rate)
 {
     int precision = 0;
     for (; sample_rate > 10; sample_rate /= 10)
Index: src/base/signal_channel.h
===================================================================
--- src/base/signal_channel.h	(revision 556)
+++ src/base/signal_channel.h	(working copy)
@@ -4,7 +4,7 @@
     Copyright (C) Thomas Brunner  2006,2007 
     Copyright (C) Christoph Eibel 2007,2008, 
     Copyright (C) Clemens Brunner 2006,2007,2008  
-    Copyright (C) Alois Schloegl  2008,2009
+    Copyright (C) Alois Schloegl  2008,2009,2011
     This file is part of the "SigViewer" repository 
     at http://biosig.sf.net/ 
 
@@ -29,6 +29,7 @@
 #define SIGNAL_CHANNEL_H
 
 #include "sigviewer_user_types.h"
+#include "biosig.h"
 
 #include <QString>
 #include <QMutex>
@@ -43,9 +44,8 @@
 {
 public:
     //-------------------------------------------------------------------------
-    SignalChannel (unsigned number,
-                   QString const& label,
-                   QString const& phys_y_dimension_label = "");
+SignalChannel (unsigned ch, const HDRTYPE* hdr);
+SignalChannel (unsigned number, CHANNEL_STRUCT C);  /* obsolete, deprecated */
 
     //-------------------------------------------------------------------------
     QString typeString() const;
@@ -59,6 +59,7 @@
     float64 getDigitalMaximum() const;
     float64 getPhysicalMinimum() const;
     float64 getDigitalMinimum() const;
+    float64 getSampleRate() const; 
 
 private:
     // from GDF format
@@ -95,6 +96,7 @@
     uint16_t data_type_;
     float64 lowpass_;
     float64 highpass_;
+    float64 samplerate_;
     bool notch_;
 };
 
Index: src/base/math_utils.h
===================================================================
--- src/base/math_utils.h	(revision 556)
+++ src/base/math_utils.h	(working copy)
@@ -42,7 +42,7 @@
 
 //-----------------------------------------------------------------------------
 /// @return number of decimals needed to display time intervals correctly
-int sampleRateToDecimalPrecision (float sample_rate);
+int sampleRateToDecimalPrecision (float64 sample_rate);
 
 }
 
Index: src/base/signal_event.cpp
===================================================================
--- src/base/signal_event.cpp	(revision 556)
+++ src/base/signal_event.cpp	(working copy)
@@ -79,9 +79,9 @@
 }
 
 //-----------------------------------------------------------------------------
-float32 SignalEvent::getPositionInSec() const
+float64 SignalEvent::getPositionInSec() const
 {
-    return static_cast<float32>(position_) / sample_rate_;
+    return static_cast<float64>(position_) / sample_rate_;
 }
 
 
@@ -104,15 +104,15 @@
 }
 
 //-----------------------------------------------------------------------------
-float32 SignalEvent::getDurationInSec() const
+float64 SignalEvent::getDurationInSec() const
 {
-    return static_cast<float32>(duration_) / sample_rate_;
+    return static_cast<float64>(duration_) / sample_rate_;
 }
 
 //-----------------------------------------------------------------------------
-float32 SignalEvent::getEndInSec () const
+float64 SignalEvent::getEndInSec () const
 {
-    return (static_cast<float32>(duration_ + position_)) / sample_rate_;
+    return (static_cast<float64>(duration_ + position_)) / sample_rate_;
 }
 
 //-----------------------------------------------------------------------------
Index: src/base/data_block.cpp
===================================================================
--- src/base/data_block.cpp	(revision 556)
+++ src/base/data_block.cpp	(working copy)
@@ -12,7 +12,7 @@
 unsigned DataBlock::instance_count_ = 0;
 
 //-----------------------------------------------------------------------------
-DataBlock::DataBlock (unsigned length, float32 sample_rate_per_unit)
+DataBlock::DataBlock (unsigned length, float64 sample_rate_per_unit)
     : length_ (length),
       sample_rate_per_unit_ (sample_rate_per_unit)
 {
@@ -79,7 +79,7 @@
 }
 
 //-------------------------------------------------------------------------
-float32 DataBlock::getSampleRatePerUnit () const
+float64 DataBlock::getSampleRatePerUnit () const
 {
     return sample_rate_per_unit_;
 }
Index: src/base/signal_event.h
===================================================================
--- src/base/signal_event.h	(revision 556)
+++ src/base/signal_event.h	(working copy)
@@ -24,12 +24,12 @@
 
     int32 getId() const;
     uint32 getPosition() const;
-    float32 getPositionInSec() const;
+    float64 getPositionInSec() const;
     uint16 getType() const;
     ChannelID getChannel() const;
     uint32 getDuration() const;
-    float32 getDurationInSec() const;
-    float32 getEndInSec () const;
+    float64 getDurationInSec() const;
+    float64 getEndInSec () const;
     float64 getSampleRate () const;
 
     void setId (EventID id);
Index: src/base/data_block.h
===================================================================
--- src/base/data_block.h	(revision 556)
+++ src/base/data_block.h	(working copy)
@@ -59,16 +59,16 @@
     std::string getYUnitLabel () const;
 
     //-------------------------------------------------------------------------
-    float32 getSampleRatePerUnit () const;
+    float64 getSampleRatePerUnit () const;
 
 protected:
     // protected constructors here:
-    DataBlock (unsigned length, float32 sample_rate_per_unit);
+    DataBlock (unsigned length, float64 sample_rate_per_unit);
     DataBlock (DataBlock const& src, unsigned new_length);
 
 private:
     uint32 length_;
-    float32 sample_rate_per_unit_;
+    float64 sample_rate_per_unit_;
 
     std::string label_;
     std::string x_unit_label_;
Index: src/src.qrc
===================================================================
--- src/src.qrc	(revision 556)
+++ src/src.qrc	(working copy)
@@ -27,7 +27,6 @@
         <file>images/file_16x16.png</file>
         <file>images/info_16x16.png</file>
         <file>images/patient_16x16.png</file>
-        <file>eventcodes.txt</file>
         <file>images/zoom_in_vertical_22x22.png</file>
         <file>images/icons/fileclose.png</file>
         <file>images/icons/fileopen.png</file>
Index: deb_building_stuff/deb_control_template
===================================================================
--- deb_building_stuff/deb_control_template	(revision 556)
+++ deb_building_stuff/deb_control_template	(working copy)
@@ -7,5 +7,5 @@
 Replaces: sigviewer (<< <version>)
 Installed-Size: <bin-size-via-script>
 Maintainer: Christoph Eibel <christoph.eibel@tugraz.at>
-Homepage: http://sigviewer.sourceforge.net
+Homepage: http://biosig.sourceforge.net
 Description: SigViewer is a powerful viewing application for biosignals, originally designed to display electroencephalographic (EEG) data.
